Current Node Version: 22.8
[https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm][Aho-Corasick] Rust library Node.js bindings
Here is an example:
import { AhoCorasick } from 'aho-corasick-node-rs'
const ac = new AhoCorasick(['let', 'it', 'be']) // allocate new trie
const matches = ac.find_iter('let it be be not found') // query for terms
console.log(matches)
[]: https://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_algorithm
There are a number of packages that are to be built and applied to the release.
The following steps need to be done for each of the platforms we are using. Please see [https://github.com/wherefortravel/aho-corasick-node-rs/releases][Releases].
With each new change, make sure to bump the package version. Please follow semantic versioning with regards to major, minor and patch version due to changes, updates or breaking changes. See [https://semver.org/][Semantic Versioning].
- bump the package version - ex. 0.1.6 to 0.1.7
- run a container with the target platform
docker run --rm -it --entrypoint "" --platform=linux/x86 -v ./:/node-rs node:22.8 /bin/bash
- install rust
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh
- navigate to the project -
cd /node-rs
- Run
rm -Rf native/target native/index.node
- Run
yarn
- Run
yarn run build:release
- Run
yarn run upload-binary
We need to make sure that the native/index.node
file is of type ELF. If it is Mach-O there is a problem and the run will not work in the container.
You can run the steps above using different platforms.
docker run --rm -it --entrypoint "" --platform=linux/x86 -v ./:/node-rs node:22.8 /bin/bash
docker run --rm -it --entrypoint "" --platform=linux/arm64 -v ./:/node-rs node:22.8 /bin/bash