Security News
Maven Central Adds Sigstore Signature Validation
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
@sapphirecode/console-app
Advanced tools
read parameters from env, config files, console args or interactively
version: 2.1.x
read parameters from env, config files, console args or interactively
npm:
npm i --save @sapphirecode/console-app
yarn:
yarn add @sapphirecode/console-app
const {
ArrayOption, // arrays made out of numbers, strings and booleans
BooleanOption,
FileOption, // paths that exist and are a file
FolderOption, // paths that exist and are a folder
NumberOption, // integer and float values
IntegerOption, // only integer values
PathOption, // paths that exist in the file system
StringOption,
} = require('@sapphirecode/console-app');
const input = await new BooleanOption({
name: 'foo', // option name used in configs and console arguments
// optional settings:
default: false, // default value
sources: {
configs: [], // config files to read from. none by default
interactive: true, // use interactive prompts
console: true // read from console arguments
// environment is always on if the 'env' option below is specified
},
alias: 'f', // shorthand console argument name
env: 'foo_env', // name of the environment variable to read from
message: 'input foo', // message to display in interactive prompt
error: 'failed to read foo', // message to display when input was invalid
error_callback: (opt, val, err)=>{...}, // function to call when an option value could not be read
exit_on_interrupt: true, // exit program when user cancels the interactive prompt
}).parse();
config files can import other config files with #include. example:
#include base.json
{
"foo": "bar"
}
config files are parsed using hjson
MIT © Timo Hocker timo@scode.ovh
FAQs
read parameters from env, config files, console args or interactively
The npm package @sapphirecode/console-app receives a total of 0 weekly downloads. As such, @sapphirecode/console-app popularity was classified as not popular.
We found that @sapphirecode/console-app 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
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.
Security News
CISOs are racing to adopt AI for cybersecurity, but hurdles in budgets and governance may leave some falling behind in the fight against cyber threats.
Research
Security News
Socket researchers uncovered a backdoored typosquat of BoltDB in the Go ecosystem, exploiting Go Module Proxy caching to persist undetected for years.