3.0.21 • Published 5 years ago

@therockstorm/utils v3.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
5 years ago

utils

npm Build Status license

Tiny utility functions

Installing

npm install @therockstorm/utils --save

API 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 test

License

MIT © Rocky Warren

3.0.21

5 years ago

3.0.20

5 years ago

3.0.19

5 years ago

3.0.18

5 years ago

3.0.17

5 years ago

3.0.16

5 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

6 years ago

3.0.8

6 years ago

3.0.7

6 years ago

3.0.6

6 years ago

3.0.5

6 years ago

3.0.3

6 years ago

3.0.2

6 years ago

3.0.1

6 years ago

3.0.0

6 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

7 years ago

1.0.6

7 years ago

1.0.5

7 years ago

1.0.4

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago