3.0.21 • Published 4 years ago

@therockstorm/utils v3.0.21

Weekly downloads
-
License
MIT
Repository
github
Last release
4 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

4 years ago

3.0.20

4 years ago

3.0.19

4 years ago

3.0.18

4 years ago

3.0.17

4 years ago

3.0.16

4 years ago

3.0.14

4 years ago

3.0.13

5 years ago

3.0.12

5 years ago

3.0.11

5 years ago

3.0.10

5 years ago

3.0.8

5 years ago

3.0.7

5 years ago

3.0.6

5 years ago

3.0.5

5 years ago

3.0.3

5 years ago

3.0.2

5 years ago

3.0.1

5 years ago

3.0.0

5 years ago

2.1.0

6 years ago

2.0.10

6 years ago

2.0.9

6 years ago

2.0.8

6 years ago

1.0.7

6 years ago

1.0.6

6 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago