Helpful nodejs/Rust APIs in zk-regex.
Installing zk-regex-apis requires a supported version of Node and Rust.
You can install the project with npm. In the project directory, run:
$ npm install
This fully installs the project, including installing any dependencies and running the build.
If you have already installed the project and only want to run the build, run:
$ npm run build
Install wasm-pack
if not already installed
cargo install wasm-pack
Compile the web package
wasm-pack build --target nodejs
Pack the package (optional)
wasm-pack build --target nodejs
cd pkg
npm pkg set type='module'
wasm-pack pack
The output package file will be packages/compiler/pkg/zk-regex-apis-1.1.1.tgz
wasm-pack test --node
In the project directory, you can run:
Installs the project, including running npm run build
.
Additional cargo build
arguments may be passed to npm build
and npm build-*
commands. For example, to enable a cargo feature:
npm run build -- --feature=beetle
Alias for npm build
.
Same as npm build
but, builds the module with the release
profile. Release builds will compile slower, but run faster.
Runs the unit tests by calling wasm-pack test --node
.
The directory structure of this project is:
zk-regex-compiler/
├── Cargo.toml
├── README.md
├── package.json
├── src/
| └── lib.rs
└── target/
The Cargo manifest file, which informs the cargo
command.
This file.
The npm manifest file, which informs the npm
command.
The directory tree containing the Rust source code for the project.
The Rust library's main module.
Binary artifacts generated by the Rust build.