
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
electron-node-loader
Advanced tools
A webpack loader that allows you loader native Node addons inside an Electron app.
This Webpack modules allows you to load a native Node.js C++ addon that can be shipped inside an Electron application.
Usage:
Let's picture an application folder:
project/
āāā dist/
āāā src/
ā āāā main.js
āāā scripts/
āāā addon.node
From your JavaScript code, you should be importing your custom module that way:
import * as addon from '../scripts/addon.node';
...
addon.doStuff();
When building your Electron app during development, add this rule to your Webpack config file:
loaders: [
{
test: /\.node?$/,
use: [
{
loader: 'electron-node-loader',
options: {
folder: 'scripts'
}
}
]
}
]
If you're using electorn-builder
for production, just add prod: true
to the options
object of the loader. You also need to add these lines in your package.json
:
"files": [
"!scripts",
],
"extraResources": [
"scripts/*.node",
]
That way, your native addons with be shipped in a special resources
directory inside of your app and your production JavaScript will be looking for them at runtime with a relative path.
FAQs
A webpack loader that allows you loader native Node addons inside an Electron app.
The npm package electron-node-loader receives a total of 140 weekly downloads. As such, electron-node-loader popularity was classified as not popular.
We found that electron-node-loader 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.