
Product
Introducing Tier 1 Reachability: Precision CVE Triage for Enterprise Teams
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
A super simple javascript implementation of Set
. As far as this module is concerned, a Set
is an unordered list of objects of the same type. This implementation doesn't try to substitute the new coming ES6 implementation for sets, but represents a much more simple and lightweight implementation.
Use a node set when you need a list of object of the same type.
npm install node-set
var NodeSet = require('node-set');
// list of possible statuses => all strings
var set = new NodeSet( String );
set.add( new String('active') );
set.add( new String('inactive') );
set.add( new String('banned') );
set.add( new String('deleted') );
set.count();
// 4
set.getData();
// [ {'0': 'active'}, {'0': 'inactive'}, {'0': 'banned'}, {'0': 'deleted'} ]
set.replace( [ new String('active'), new String('inactive') ] );
// [ {'0': 'active'}, {'0': 'inactive'} ]
set.add( new Number(10) );
// TypeError thrown as `Number` is not type `String`
The only dev dependency is coffee-script
which can be installed running 'npm install' mocha
and should
are used in the testing suite. The coffeescript is compiled down to javascript automatically before publishing using the 'prepublish' script in 'package.json'. coffeescript files and test files are deliberately left out of the package via '.npmignore'
because no one likes needlessly big modules.
Contributions are welcome!
MIT
FAQs
Set data structure
We found that node-set 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.
Product
Socket’s new Tier 1 Reachability filters out up to 80% of irrelevant CVEs, so security teams can focus on the vulnerabilities that matter.
Research
/Security News
Ongoing npm supply chain attack spreads to DuckDB: multiple packages compromised with the same wallet-drainer malware.
Security News
The MCP Steering Committee has launched the official MCP Registry in preview, a central hub for discovering and publishing MCP servers.