
Security News
PEP 810 Proposes Explicit Lazy Imports for Python 3.15
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
@lando/argv
Advanced tools
A very simple module called argv
that allows you to:
process.argv
process.argv
# With npm
npm install @lando/argv
# With yarn
yarn add @lando/argv
This module has two functions hasOption
and getOption
.
Checks to see if a flag exists in process.argv
.
const argv = require('argv');
// Will return Boolean
const hasDebug = argv.hasOption('--debug'));
Returns the value of the flag. If the flag is a switch then it will return true|false
by default. If the flag has a string
value it will return that string value.
// File: myscript.js
const argv = require('argv');
console.log(argv.getOption('--debug'));
The above code will produce the following:
node myscript.js --debug
> true
node myscript.js --debug "trill"
> trill
hyperdrive list --debug=trill
> trill
You also can replace the default Boolean value with the defaultValue
option.
// File: myscript.js
const argv = require('argv');
console.log(argv.getOption('--debug', {defaultValue: 'the-truth-is-out-there'}));
node myscript.js --debug
> the-truth-is-out-there
If you have a question or would like some community support we recommend you join us on Slack. Note that this is the Slack community for Lando but we are more than happy to help with this module as well!
If you'd like to report a bug or submit a feature request then please use the issue queue in this repo.
We try to log all changes big and small in both THE CHANGELOG and the release notes.
git clone https://github.com/lando/argv.git && cd argv
yarn install
If you dont' want to install Node 14 or Yarn for whatever reason you can install Lando and use that:
git clone https://github.com/lando/argv.git && cd argv
# Install deps and get node
lando start
# Run commands
lando node
lando yarn
# Lint the code
yarn lint
# Run unit tests
yarn test
yarn release
v1.0.4 October 15, 2021
npm
[#3]FAQs
A package for handling argv.
The npm package @lando/argv receives a total of 55 weekly downloads. As such, @lando/argv popularity was classified as not popular.
We found that @lando/argv demonstrated a healthy version release cadence and project activity because the last version was released less than 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
An opt-in lazy import keyword aims to speed up Python startups, especially CLIs, without the ecosystem-wide risks that sank PEP 690.
Security News
Socket CEO Feross Aboukhadijeh discusses the recent npm supply chain attacks on PodRocket, covering novel attack vectors and how developers can protect themselves.
Security News
Maintainers back GitHub’s npm security overhaul but raise concerns about CI/CD workflows, enterprise support, and token management.