2020-06-09 13:13:27 +02:00
2020-05-05 11:56:36 +02:00
2020-05-15 16:53:45 +02:00
2020-05-05 11:56:36 +02:00
2020-05-05 13:32:40 +02:00
2020-06-09 21:23:26 +02:00
2020-05-15 16:53:45 +02:00
2020-06-09 21:33:48 +02:00
2020-05-05 13:32:40 +02:00
2020-05-27 17:39:32 +02:00
2020-05-18 10:24:41 +02:00
2020-05-27 17:39:32 +02:00
2020-06-09 13:58:29 +02:00

@sapphirecode/console-app

version: 1.8.x

read parameters from env, console args or interactively

Installation

npm:

npm i --save @sapphirecode/console-app

yarn:

yarn add @sapphirecode/console-app

Usage

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,
  PathOption, // paths that exist in the file system
  StringOption,
} = require('@sapphirecode/console-app');

####################################

configs: ['json files to search for options'], exit_on_interrupt: true, // exit program when user cancels prompt error_callback: (opt, val, err)=>{...} // function to call when an option value could not be read

the parameter sources specifies which sources should be used. It reads from all, except config files by default

config files can import other config files with #include. example:

#include base.json
{
  "foo": "bar"
}

config files are parsed using hjson

License

MIT © Timo Hocker timo@scode.ovh

Description
No description provided
Readme 409 KiB
Languages
TypeScript 96.5%
JavaScript 3.5%