3.0.21 • Published 5 years ago
@therockstorm/utils v3.0.21
utils
Tiny utility functions
Installing
npm install @therockstorm/utils --saveAPI Reference
log
Calls console.log
utils.log('My message')debug
Calls console.debug with [debug] prefix
utils.debug('My message')info
Calls console.info with [info] prefix
utils.info('My message')warn
Calls console.warn with [warn] prefix
utils.warn('My message')error
Calls console.error with [error] prefix
utils.error('My message')envVar
Returns argument from process.env or throws if undefined
const value = utils.envVar('MY_KEY')required
Returns first argument or throws using second argument as error message if undefined
const value = utils.required(process.argv[1], 'myOption')thrw
Throws an exception, can be used in locations throw cannot
myVal ? doSomething() : thrw('error')Developing
# Install dependencies
nvm install && nvm use && npm install
# Run tests
npm testLicense
MIT © Rocky Warren
3.0.21
5 years ago
3.0.20
5 years ago
3.0.19
6 years ago
3.0.18
6 years ago
3.0.17
6 years ago
3.0.16
6 years ago
3.0.14
6 years ago
3.0.13
6 years ago
3.0.12
6 years ago
3.0.11
6 years ago
3.0.10
7 years ago
3.0.8
7 years ago
3.0.7
7 years ago
3.0.6
7 years ago
3.0.5
7 years ago
3.0.3
7 years ago
3.0.2
7 years ago
3.0.1
7 years ago
3.0.0
7 years ago
2.1.0
7 years ago
2.0.10
7 years ago
2.0.9
7 years ago
2.0.8
7 years ago
1.0.7
8 years ago
1.0.6
8 years ago
1.0.5
8 years ago
1.0.4
8 years ago
1.0.3
8 years ago
1.0.2
8 years ago
1.0.1
8 years ago
1.0.0
8 years ago