{"id":18596,"library":"neon-cli","title":"Neon CLI","description":"Official command-line tool for creating, building, and loading native Rust/Node.js modules using the Neon bindings framework. Current stable version is 0.10.1, targeting Node >=8 and N-API. The CLI provides scaffolding and build infrastructure for Neon projects; the core Neon library (separate package) enables high-performance Rust addons with a safe, idiomatic Rust API. Differentiates from napi-rs with a more Rust-centric declarative API and a mature macro-based approach. Release cadence is periodic with major versions (1.0.0-alpha pre-releases available).","status":"active","version":"0.10.1","language":"javascript","source_language":"en","source_url":"https://github.com/neon-bindings/neon","tags":["javascript","typescript"],"install":[{"cmd":"npm install neon-cli","lang":"bash","label":"npm"},{"cmd":"yarn add neon-cli","lang":"bash","label":"yarn"},{"cmd":"pnpm add neon-cli","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Runtime library for Neon modules; the CLI creates projects that depend on it","package":"neon","optional":false}],"imports":[{"note":"The CLI is primarily used as a command-line tool, not imported programmatically. However, if imported, it provides programmatic APIs. Use ESM import syntax.","wrong":"const neon = require('neon-cli')","symbol":"neon","correct":"import { neon } from 'neon-cli'"},{"note":"Programmatic build function. Available from v0.10.0+.","wrong":"const build = require('neon-cli').build","symbol":"build","correct":"import { build } from 'neon-cli'"},{"note":"Loads a Neon module into Node.js. Correct import is from 'neon-cli' directly.","wrong":"const load = require('neon-cli/build').load","symbol":"load","correct":"import { load } from 'neon-cli'"}],"quickstart":{"code":"npx neon new my-project\ncd my-project\nnpm install\nnpx neon build\nnpx node -e \"const m = require('./native'); console.log(m.hello())\"","lang":"typescript","description":"Creates a new Neon project, builds the native Rust module, and runs a simple test to verify the module loads and works."},"warnings":[{"fix":"Ensure your Neon module uses N-API only. Remove any legacy backend dependencies.","message":"Removal of legacy backend in v1.0.0-alpha.1: only Node-API is supported going forward.","severity":"breaking","affected_versions":">=1.0.0-alpha.1"},{"fix":"Update Rust code to use usize for length-related values.","message":"Length APIs (argument, argument_ops, len) now use usize instead of i32 in v1.0.0-alpha.1.","severity":"breaking","affected_versions":">=1.0.0-alpha.1"},{"fix":"Remove usage of This trait. The declare_types macro was already removed.","message":"Removal of neon::object::This trait in v1.0.0-alpha.2.","severity":"breaking","affected_versions":">=1.0.0-alpha.2"},{"fix":"Ensure exported function names use camelCase in JavaScript, or rename Rust functions accordingly.","message":"Snake_case to camelCase conversion when exporting functions in v1.1.0-alpha.2.","severity":"breaking","affected_versions":">=1.1.0-alpha.2"},{"fix":"Update JsFunction usage to remove generic parameter.","message":"Removal of generic parameter from JsFunction in v1.0.0.","severity":"breaking","affected_versions":">=1.0.0-alpha.4"},{"fix":"Upgrade to v0.10.1 or later. Ensure external data has 'static lifetime.","message":"Soundness hole in JsArrayBuffer::external and JsBuffer::external (fixed in v0.10.1). Previous versions allowed creating buffers without 'static lifetime.","severity":"gotcha","affected_versions":"<0.10.1"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run 'npx neon' instead, or install globally with 'npm install -g neon-cli'.","cause":"neon-cli not installed globally or npx not used.","error":"neon: command not found"},{"fix":"Add 'neon = \"0.10\"' to [dependencies] in Cargo.toml.","cause":"Missing neon dependency in Cargo.toml.","error":"error[E0433]: failed to resolve: could not find `neon` in the crate root"},{"fix":"Run 'npx neon build' to rebuild the native module. Ensure Node.js version matches the module's target.","cause":"Neon module not built correctly or Node.js ABI mismatch.","error":"Error: Module did not self-register"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}