ashvardanian / StringZilla

Up to 10x faster strings for C, C++, Python, Rust, and Swift, leveraging SWAR and SIMD on Arm Neon and x86 AVX2 & AVX-512-capable chips to accelerate search, sort, edit distances, alignment scores, etc 🦖
https://ashvardanian.com/posts/stringzilla/
Apache License 2.0
1.92k stars 64 forks source link

Initial nodejs string wrap #151

Open MarkReedZ opened 2 months ago

MarkReedZ commented 2 months ago

I've created a Str object wrapper for Node.js

    const a = new stringzilla.Str('hello world');
    const b = new stringzilla.Str('hi');

    const result_1 = a.count(b);

And implemented a few functions with tests.

        {"indexOf", NULL, str_find, NULL, NULL, NULL, napi_default, NULL},
        {"find", NULL, str_find, NULL, NULL, NULL, napi_default, NULL},
        {"rfind", NULL, str_rfind, NULL, NULL, NULL, napi_default, NULL},
        {"startswith", NULL, str_startswith, NULL, NULL, NULL, napi_default, NULL},
        {"endswith", NULL, str_endswith, NULL, NULL, NULL, napi_default, NULL},
        {"count", NULL, str_count, NULL, NULL, NULL, napi_default, NULL}