0.1.10 • Published 4 years ago

mkcmdargv v0.1.10

Weekly downloads
4
License
MIT
Repository
github
Last release
4 years ago

Create Command Arguments

Convert environment variables to command-line arguments

Executable Usage

export MKCMDARGV_ARGS='[abc def]'
export MKCMDARGV_OPTIONS='{ a: 0, foo: 123 }'
export MKCMDARGV_SINGLE_FLAGS='sfx'
export MKCMDARGV_DOUBLE_FLAGS='quiet splash'
echo $(mkcmdargv)

API Usage

iterateCommandArguments

Creates an iterator of command arguments

const { iterateCommandArguments } = require('mkcmdargv')

console.log(...iterateCommandArguments({
  args: ['abc', 'def'],
  options: { a: 0, foo: 123 },
  flags: ['s', 'f', 'x', 'quiet', 'splash']
}))

createCommandArguments

Creates an array of command arguments

const { createCommandArguments } = require('mkcmdargv')

createCommandArguments({
  args: ['abc', 'def'],
  options: { a: 0, foo: 123 },
  flags: ['s', 'f', 'x', 'quiet', 'splash']
}).forEach(arg => console.log(arg))

License

MIT © Hoàng Văn Khải

0.1.10

4 years ago

0.1.9

5 years ago

0.1.8

5 years ago

0.1.7

5 years ago

0.1.6

5 years ago

0.1.4

5 years ago

0.1.5

5 years ago

0.1.2

5 years ago

0.1.1

5 years ago

0.1.0

5 years ago

0.0.0

5 years ago