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.
babel-plugin-inject-args
Advanced tools
Babel plugin that makes function argument names accessible at runtime
Babel plugin that processes specially annotated functions or classes and exposes the names of their parameters as runtime-accessible metadata. This can be used by dependency injection containers to call the function or instantiate the class and automatically resolve dependencies.
To enable this metadata for a function or class, add the string @inject
in a leading comment. The plugin will add a $inject
property to the object
which contains an array of parameter names. For example, this source:
// @inject
function createThing(paramA, paramB) {
}
Is transformed into:
// @inject
function createThing(paramA, paramB) {
}
myService.$inject = ['paramA', 'paramB'];
ES classes are also supported:
// @inject
class Thing {
constructor(paramA, paramB) { … }
}
Is transformed into:
// @inject
class Thing {
constructor(paramA, paramB) { … }
}
Thing.$inject = ['paramA', 'paramB'];
To use the plugin, first add the dependency to your project:
npm install --save-dev babel-plugin-inject-args
Then enable the plugin in your Babel configuration, for example in a .babelrc
file:
{
"plugins": ["inject-args"]
}
For information on understanding the plugin implementation, see https://github.com/jamiebuilds/babel-handbook.
FAQs
Babel plugin that makes function argument names accessible at runtime
The npm package babel-plugin-inject-args receives a total of 65 weekly downloads. As such, babel-plugin-inject-args popularity was classified as not popular.
We found that babel-plugin-inject-args 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.