Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
@opt/require
Advanced tools
Plugin for @opt/parse adding type def which calls require() on the value.
Plugin for @opt/parse adding type def which calls require() on the value.
It adds to nopt's typeDef
a new type marked by the string require
. When an option has that type it is tested as a path first, then, require()
is called on it to get the result, which is placed into the parsed options.
Basically, you can do an option like: name: require
and name: [require, Array]
and you'll get back the result of the require operation in the name
property.
See @opt/parse
See @opt/nopt
See @use/core
npm install @opt/require --save
var parse = require('@opt/parse')
// make nopt the parser and apply our require plugin
parse.use('@opt/nopt', '@opt/require')
var options = {
// the type def is marked with string 'require()'
// this allows multiple of them, set into an array.
plugin: [require, Array]
}
// an example args array with a plugin option to require()
// the module path must be absolute, or relative to CWD. or use ~/
var argv = [ 'node', 'some.js', '--plugin', 'some/module' ]
// then use parse as you would use `nopt`,
// plus any changes made possible by the plugins added
options = parse(options, {}, argv, 2)
// the above would produce:
options = {
// can't write a function... so, 'theModuleFunction' means a real function
// returned by require('some/module')
plugin: [ theModuleFunction ]
argv: {
original: [ 'node', 'some.js', '--plugin', 'some/module' ]
original: [ 'node', 'some.js', '--plugin', 'some/module' ]
remain : []
}
}
FAQs
Plugin for @opt/parse adding type def which calls require() on the value.
We found that @opt/require demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
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.