🎩 You're Invited:Meet the Socket team at Black Hat in Las Vegas, August 3-6.RSVP →
Sign In

@napi-rs/cli

Package Overview
Dependencies
Maintainers
2
Versions
248
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@napi-rs/cli

Cli tools for napi-rs

latest
Source
npmnpm
Version
3.8.2
Version published
Weekly downloads
1M
-7.12%
Maintainers
2
Weekly downloads
 
Created
Source

@napi-rs/cli

Download Install size chat

Cli tools for napi-rs

# or npm, pnpm
yarn add @napi-rs/cli -D
yarn napi build

Requirements

@napi-rs/cli supports Node.js ^20.17.0, ^22.13.0, and >=23.5.0. Earlier Node.js releases are no longer supported by the CLI runtime.

Commands

Commanddescdocs
newcreate new napi-rs project./docs/new.md
buildbuild napi-rs project./docs/build.md
create-npm-dirsCreate npm package dirs for different platforms./docs/create-npm-dirs
artifactsCopy artifacts from Github Actions into specified dir./docs/artifacts.md
renameRename the napi-rs project./docs/rename.md
universalizeCombile built binaries into one universal binary./docs/universalize.md
versionUpdate version in created npm packages by create-npm-dirs./docs/version.md
pre-publishUpdate package.json and copy addons into per platform packages./docs/pre-publish.md

Disposing generated WASI bindings

Generated WASI bindings expose deterministic cleanup through a non-enumerable symbol on the binding object:

const binding = require('<package>')
const dispose = binding[Symbol.for('napi.rs.wasi.dispose')]

if (dispose) {
  await dispose()
}

The symbol is present only when the loaded binding is WASI. Browser WASI loaders expose it on their default export. Disposal releases the instance: it destroys the emnapi context and then terminates the workers owned by that binding. Pending napi-rs runtime promises are settled or cancelled first only when the binary exports the napi_prepare_wasm_env_cleanup preparation hook (a planned napi-side follow-up); otherwise they may remain pending forever, so settle in-flight work before disposing. Concurrent calls share one promise, successful disposal is idempotent, and a failed cleanup phase can be retried by calling the same function again. Do not call addon exports after disposal completes.

See WASI targets and loaders for threaded, threadless, browser, and workerd packaging behavior.

Debug mode

DEBUG="napi:*" napi [command]

Keywords

cli

FAQs

Package last updated on 31 Jul 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts