Security News
tea.xyz Spam Plagues npm and RubyGems Package Registries
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
argsparser
Advanced tools
Readme
The target is to get a key-value object from an array. A key can be the first element or element prefixed by "-" and "--" (switch). So the parser loops through the array and looks for keys. After he could detect an a key all next elements will be added as a value of this key until he find another key. If there is no value, then the key is true (boolean). If there are a lot of values, then the key is an array.
node script.js -> {"node": "script.js"}
node script.js -o -> {"node": "script.js", "-o": true}
node script.js -o test -> {"node": "script.js", "-o": "test"}
node script.js -a testa --b testb -> {node: "script.js", "-a": "testa", "--b": "testb"}
node script.js -paths /test.js /test1.js -> {node: "script.js", "-paths": ["/test.js", "/test1.js"]}
// per default it parses process.argv
var args = require( "argsparser" ).parse(); // {"node": "/path/to/your/script.js"}
// optional you can pass your own arguments array
var args = require( "argsparser" ).parse(["-a", "test"]); // {"-a": "test"}
npm install argsparser
FAQs
A tiny command line arguments parser
The npm package argsparser receives a total of 1,778 weekly downloads. As such, argsparser popularity was classified as popular.
We found that argsparser 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.
Security News
Tea.xyz, a crypto project aimed at rewarding open source contributions, is once again facing backlash due to an influx of spam packages flooding public package registries.
Security News
As cyber threats become more autonomous, AI-powered defenses are crucial for businesses to stay ahead of attackers who can exploit software vulnerabilities at scale.
Security News
UnitedHealth Group disclosed that the ransomware attack on Change Healthcare compromised protected health information for millions in the U.S., with estimated costs to the company expected to reach $1 billion.