
Research
/Security News
Fake imToken Chrome Extension Steals Seed Phrases via Phishing Redirects
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.
napi-postinstall
Advanced tools
The `postinstall` script helper for handling native bindings in legacy `npm` versions
The postinstall script helper for handling native bindings in legacy npm versions, this is a reimplementation of the node-install functionality from esbuild for napi-rs ecosystem packages like rollup, @swc/core and unrs-resolver.
For more details, please refer to the following issues:
# pnpm
pnpm add napi-postinstall
# yarn
yarn add napi-postinstall
# npm
npm i napi-postinstall
# bun
bun add napi-postinstall
napi-postinstall unrs-resolver #<napi-package-name>
You can put it into scripts#postinstall of your package.json:
{
"scripts": {
"postinstall": "napi-postinstall unrs-resolver"
}
}
This will check and prepare the napi binding packages for you automatically.
// napi-postinstall
export interface PackageJson {
name: string
version: string
}
export declare function checkAndPreparePackage(
packageNameOrPackageJson: PackageJson | string,
checkVersion?: boolean,
): Promise<void>
// napi-postinstall/fallback
declare function fallback<T = unknown>(
packageJsonPath: string,
checkVersion?: boolean,
): T
export = fallback
// index.js
const { checkAndPreparePackage, isNpm } = require('napi-postinstall')
if (isNpm()) {
void checkAndPreparePackage('unrs-resolver' /* <napi-package-name> */)
}
// fallback.js
module.exports = require('napi-postinstall/fallback')(
require.resolve('./package.json') /* <napi-package-json-path> */,
true /* <check-version> */,
)
| 1stG | RxTS | UnTS |
|---|---|---|
| 1stG | RxTS | UnTS |
|---|---|---|
Detailed changes for each release are documented in CHANGELOG.md.
FAQs
The `postinstall` script helper for handling native bindings in legacy `npm` versions
The npm package napi-postinstall receives a total of 21,811,145 weekly downloads. As such, napi-postinstall popularity was classified as popular.
We found that napi-postinstall demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

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.

Research
/Security News
Mixed-script homoglyphs and a lookalike domain mimic imToken’s import flow to capture mnemonics and private keys.

Security News
Latio’s 2026 report recognizes Socket as a Supply Chain Innovator and highlights our work in 0-day malware detection, SCA, and auto-patching.

Company News
Join Socket for live demos, rooftop happy hours, and one-on-one meetings during BSidesSF and RSA 2026 in San Francisco.