
Security News
vlt Launches "reproduce": A New Tool Challenging the Limits of Package Provenance
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
@tslib/argv
Advanced tools
yarn add @tslib/argv
- Add the command line definition file: "cmdline.ts"
import argv from '@tslib/argv';
// Automatically import version information, it can also be manually defined
import pkg = require('../package.json');
/**
* Export the parsed command line
*/
export default argv(
pkg.name,
pkg.version,
` Example using for Test ts argv library
You can using: "${pkg.name} [cmd] params ..." to test it
`,
{
cmd: {
short: null, // Define short is null, set cmd to command parameter parsing mode
desc: 'default cmd is "run",other:"test","build"',
value: 'run', // default value
},
port: {
short: 'p',
desc: 'service listen port,default:3000',
value: 3000, // default value
},
boo: {
short: 'b',
desc: 'service listen port,default:3000',
value: true, // default value
}
}
);
jsonImport.ts added to the project source file directory, without using import import
declare module "*.json" {
const value: any;
export = value;
}
import cmdline from './cmdline';
console.log('cmd', cmdline.cmd);
console.log('port', cmdline.port);
console.log('boo', cmdline.boo);
- import cmdline is a read-only object that prevents accidental changes to variables
- boolean type parameter receives 'null', '0', 'false', as false, others are true
TypeScript full stack development library, dedicated to all types of front and back end component development
FAQs
parse argument for TypeScript
The npm package @tslib/argv receives a total of 0 weekly downloads. As such, @tslib/argv popularity was classified as not popular.
We found that @tslib/argv demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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
vlt's new "reproduce" tool verifies npm packages against their source code, outperforming traditional provenance adoption in the JavaScript ecosystem.
Research
Security News
Socket researchers uncovered a malicious PyPI package exploiting Deezer’s API to enable coordinated music piracy through API abuse and C2 server control.
Research
The Socket Research Team discovered a malicious npm package, '@ton-wallet/create', stealing cryptocurrency wallet keys from developers and users in the TON ecosystem.