Research
Security News
Quasar RAT Disguised as an npm Package for Detecting Vulnerabilities in Ethereum Smart Contracts
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
extract-opts
Advanced tools
Extract the options and callback from a function's arguments easily
npm install --save extract-opts
var extractOpts = require('extract-opts').extractOpts;
// fs.readFile(filename, [options], callback)
var readFile = function(filename, opts, callback){
// Extract options and callback
var args = extractOpts(opts, callback);
opts = args[0];
callback = args[1];
// Forward for simplicities sake
require('fs').readFile(filename, opts, callback);
};
// Test it
var next = console.log.bind(console);
readFile('package.json', next); // works with no options
readFile('package.json', null, next); // works with null options
readFile('package.json', {next:next}); // works with just options
You can discover the history inside the History.md
file
Licensed under the incredibly permissive MIT License
Copyright © 2013+ Bevry Pty Ltd
Copyright © 2011-2012 Benjamin Arthur Lupton
FAQs
Extract the options and callback from a function's arguments easily
We found that extract-opts demonstrated a healthy version release cadence and project activity because the last version was released less than 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
Socket researchers uncover a malicious npm package posing as a tool for detecting vulnerabilities in Etherium smart contracts.
Security News
Research
A supply chain attack on Rspack's npm packages injected cryptomining malware, potentially impacting thousands of developers.
Research
Security News
Socket researchers discovered a malware campaign on npm delivering the Skuld infostealer via typosquatted packages, exposing sensitive data.