![require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages](https://cdn.sanity.io/images/cgdhsj6q/production/be8ab80c8efa5907bc341c6fefe9aa20d239d890-1600x1097.png?w=400&fit=max&auto=format)
Security News
require(esm) Backported to Node.js 20, Paving the Way for ESM-Only Packages
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
fuse-box-node-plugin
Advanced tools
Plugin for fuse-box to allow inclusion of .node
binaries and related dependencies
Install via npm i fuse-box-node-plugin --save-dev
.
NodePlugin
follows the factorization and configuration pattern of official fuse-box plugins.
Including const {NodePlugin} = require("fuse-box-node-plugin");
will return a factory function, which accepts an options literal in the following format:
interface NodePluginOptions {
// file path to the .node file
file: string;
// a root folder to be used when copying over, defaults to file's dirname
root?: string;
// output folder for NodePlugin assets. defaults to "modules"
moduleFolder?: string
// defaults to file's basename, defines subfolder in moduleFolder
identifier?: string;
// a list of globs relative root-folder, matching files will be copied into the bundle
relativeDependencies?: string[];
}
The sharp-package creates platform specific files during npm's prebuild-step.
sharp.node
in node_modules/sharp/Build/Release/
node_modules/sharp/vendor/
sharp.node
requires most of these files, depending on features used in your code, and looks for them relative to itself.
To include sharp
in your fuse-box bundle add NodePlugin
to your plugin configuration:
plugins: [
NodePlugin({
file: "node_modules/sharp/build/Release/sharp.node",
root: "node_modules/sharp",
relativeDependencies: ["**.dll", "vendor/**"]
})
]
This will generate a modules/sharp/
directory in your configured output, which mirrors the tree structure of node_modules/sharp
for all files matching relativeDependencies
.
FAQs
a cli tool to reduce your docker-compose overhead
We found that fuse-box-node-plugin demonstrated a not healthy version release cadence and project activity because the last version was released 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.
Security News
require(esm) backported to Node.js 20, easing the transition to ESM-only packages and reducing complexity for developers as Node 18 nears end-of-life.
Security News
PyPI now supports iOS and Android wheels, making it easier for Python developers to distribute mobile packages.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.