Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
component-npm-post-install
Advanced tools
Post-install script for npm(1) which makes a component to be a valid npm module
Post-install script for npm(1)
which makes a component to be a valid node module.
It loops through a packages installed in a node_modules
dir and creates additional
files effectively aliasing short component names with names created by npm(1)
.
Please note! Post install scripts are considered to be a bad practice. In this concrete case there should not be any practical downside. Nevertheless it is a break for convention. For example, some tool might be confused. So, please, you use this script only for private needs or as a temporary hack.
Just create a package.json
for the component you want to publish and specify
component-npm-post-install
as a post install script.
{
"name": "foo",
"dependencies": {
"bar": "*",
"org-baz": "*",
"org-qux": "org/url-of-foo-on-github",
"quux-very-strange-npm-suffix-to-avoid-ns-clash": "*",
"component-npm-post-install": "*"
},
"scripts": {
"postinstall": "component-npm-post-install"
}
}
As a result you will have addional baz.js
, qux.js
, quux.js
files in node_modules
.
They have a form of:
baz.js
module.exports = require("org-baz")
For this to work every npm package must include component.json
.
with npm
npm install component-npm-post-install
Another way to consume components from node is to require them.
MIT
FAQs
Post-install script for npm(1) which makes a component to be a valid npm module
The npm package component-npm-post-install receives a total of 1 weekly downloads. As such, component-npm-post-install popularity was classified as not popular.
We found that component-npm-post-install 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.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.