npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@bastani/atomic-natives

v0.10.17

Published

Native Rust bindings for Atomic via N-API

Readme

@bastani/atomic-natives

Native Rust bindings for Atomic exposed through N-API.

This package is a required dependency of @bastani/atomic, while its eight per-platform binary subpackages (@bastani/atomic-natives-<platform>) are installed as optionalDependencies of @bastani/atomic-natives. Most users do not need to install it directly. The Rust source lives in crates/atomic-natives, while this package publishes the generated NAPI-RS loader (native/index.js), TypeScript declarations (native/index.d.ts), and per-platform binary packages.

See Atomic's docs for package manager troubleshooting, Termux setup, environment variables, and the SDK.

Install

@bastani/atomic installs @bastani/atomic-natives automatically. Do not pass --omit=optional when installing in a project, because npm skips the platform binary subpackages and Atomic exits or throws NativeModuleUnavailableError.

To install directly for diagnostics or standalone tooling:

npm install @bastani/atomic-natives

Quick start

import { grep, nativeVersion } from "@bastani/atomic-natives";

console.log("Native addon version:", nativeVersion());

const result = await grep({
	pattern: "TODO",
	path: ".",
	glob: "*.ts",
	maxCount: 20,
});

for (const match of result.matches) {
	console.log(`${match.path}:${match.lineNumber}: ${match.line}`);
}

What it provides

  • PTY execution: PtySession backs interactive pseudo-terminal execution for bash tool calls with pty: true.
  • Fast filesystem search: glob(), grep(), search(), hasMatch(), and invalidateFsScanCache() power Atomic's built-in find and search tools.
  • Task supervision: TaskSupervisor supervises owned command and agent tasks, wait budgets, cancellation, cleanup, process-group containment, and output spooling.
  • Subagent control: SubagentControl enforces root-scoped subagent admission, depth and concurrency limits, and child status watches.
  • Process spawning and containment: HostProcess, startHostProcess(), containProcessTree(), containProcessTreeAllowingBreakaway(), holdProcessDescendants(), holdWindowsProcessExit(), processCreationTime(), terminateProcessCreatedAt(), and killSupervisedProcessTrees() manage helper subprocesses and ensure process trees shut down cleanly across Unix and Windows.
  • Advisory file locks and atomic renames: AdvisoryLock, tryAdvisoryLock(), tryAdvisoryLockAsync(), trySharedAdvisoryLock(), trySharedAdvisoryLockAsync(), renameNoReplace(), and renameNoReplaceAsync() coordinate cross-process file access.
  • Runtime and OS helpers: nativeVersion(), pendingStdinInput(), signalIgnored(), watchSessionEnd(), and Windows directory security, file-pinning, and monotonic clock helpers.

Supported platforms

Prebuilt binaries are published for eight targets:

  • macOS: x86_64-apple-darwin (Intel), aarch64-apple-darwin (Apple Silicon)
  • Linux (glibc): x86_64-unknown-linux-gnu, aarch64-unknown-linux-gnu
  • Linux (musl): x86_64-unknown-linux-musl, aarch64-unknown-linux-musl
  • Windows: x86_64-pc-windows-msvc, aarch64-pc-windows-msvc

Android and Termux do not have prebuilt binaries. Atomic requires @bastani/atomic-natives to start any session and exits or throws NativeModuleUnavailableError without a compatible binary, so Android and Termux users must build the addon locally and set NAPI_RS_NATIVE_LIBRARY_PATH (Termux setup).

Overriding the native binary

At startup, Atomic compares nativeVersion() against the installed Atomic release version and refuses a mismatched binary. To load a locally built .node file (which bypasses the release version check), set NAPI_RS_NATIVE_LIBRARY_PATH (Environment variables):

export NAPI_RS_NATIVE_LIBRARY_PATH=/path/to/atomic_natives.node
atomic

Building from source

Building requires a Rust toolchain (rustup / cargo) and Bun (1.4.5+). From the repository root:

npm run build --workspace=@bastani/atomic-natives

Or from inside packages/natives/:

bun run build        # Release build
bun run build:debug  # Debug build

License

MIT. See LICENSE.