Back to Explore

un-ts/napi-postinstall

GitHub
4 updates · last 90 daysOpen source

Last release:

napi-postinstall is a helper you run from an npm postinstall script to automatically check and prepare napi native binding packages, specifically for legacy npm versions. It provides a CLI and an API function for ensuring the required napi binding artifacts are set up during installation (including a fallback module).

Project status

  • The source is actively maintained at present, with an upstream push on 2026-11-04 and updates as recently as 2026-11-03.
  • Its cadence is uneven: after a gap of about a year, updates clustered from October to November 2026.

AI summary generated

AI-generated from public sources. May be inaccurate. Report

Recent updates

  • v0.3.8

    v0.3.8 fixes hanging processes by consuming redirect and non-200 HTTP responses, allowing keep-alive sockets to be released. The library API and dependency versions are otherwise unchanged.

  • v0.3.7

    v0.3.7 adds a new `napi-patch` CLI/bin to inject the runtime fallback block into generated napi-rs loaders, and improves the install-time binary handling so the runtime fallback can still work when Node caches a failed optional dependency lookup. It also centralizes and expands the logic for computing the `SKIP_<PACKAGE>_FALLBACK` environment variable.

    Features
  • v0.3.6

    v0.3.6 is a patch release focused on making `napi-postinstall` more reliable on npm setups affected by npm/cli#4828. The main improvements are better detection of host manifests and WASI targets, and safer nested installs that respect the project `.npmrc` and avoid leaking credentials.

    SecurityFeatures
  • v0.3.5

    v0.3.5 is a patch release focused on improving how napi-postinstall selects the WASI fallback when WebAssembly WASI bindings are present. It also includes various repo and CI/build tooling updates (Yarn, Changesets, and documentation hosting).

    Features
  • v0.3.4

    v0.3.4 extends platform and target resolution to support the loong64 architecture and the OpenHarmony platform. Release notes only mention that feature addition, but the code also changes how certain triples are interpreted and how Windows MinGW targets are selected.

    Features
  • v0.3.3

    v0.3.3 adds support for fetching registry metadata over plain HTTP (not just HTTPS). It also updates the CLI to attempt reading the current working directory's package.json, and uses that data when it matches the provided package name and version.

    Features
  • v0.3.2

    Release v0.3.2 is effectively a republish/reversion update with minimal changes. The only substantive diff is a small documentation snippet change in README, plus the package version bump to 0.3.2.

  • v0.3.0

    v0.3.0 introduces a runtime fallback mechanism with support for WebContainer-like environments. The codebase adds a new `napi-postinstall/fallback` entry point that attempts to resolve the correct NAPI binding at runtime, including downloading the WebAssembly WASI binding when needed.

    Features
  • v0.2.5

    Release v0.2.5 is a small patch release. The documented change is expanding redirect handling in the internal fetch logic to also follow HTTP 307 and 308 responses.

  • v0.2.4

    v0.2.4 is a patch release that updates the TypeScript compilation target to ES2020 to improve compatibility with Node versions below 15. The release notes only mention this change, but the diff also includes several developer-tooling dependency and lockfile updates.

  • v0.2.3

    v0.2.3 is a patch release that targets postinstall installation reliability. The documented change is a fix for a case where the destination directory for a newly installed binary could be missing.

  • v0.2.2

    v0.2.2 is a patch release that changes how napi-postinstall behaves around Yarn Plug'n'Play, specifically to stop attempting an automatic patching flow that the project considers impossible. The code changes also touch error handling and logging, and add environment detection utilities.

  • v0.2.1

    v0.2.1 is a patch release focused on improving WebContainer compatibility by ensuring the wasm32-wasi target is used. The code changes also expand the wasm32-wasi installation logic beyond just selecting the target, altering how npm installs and how node_modules content is moved into place.

  • v0.2.0

    v0.2.0 introduces support for reading a dependency package.json from the npm registry when it cannot be loaded locally, intended to improve compatibility in yarn and pnpm setups. The implementation also changes how the CLI and the exported checkAndPreparePackage function accept arguments, and it loosens some validation behavior around missing optional dependency version entries.

    Features