0.3.2 • Published 6 years ago

@compositor/util v0.3.2

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

util Build Status

Collection of node utilities for compositor apps. Currently all utility functions are found in index.js. We will likely move them into their own directories eventually.

installation

npm i -S @compositor/util

usage

timeNow()
const { timeNow } = require('@compositor/util')

timeNow() // => Time since epoch as integer
hash(string, sha)
const { hash } = require('@compositor/util')

hash('foo') // => 'SOME SHA256 HEX'
hash('foo', '512') // => 'SOME SHA512 HEX'
uuid
const { uuid } = require('@compositor/util')

uuid()
envPostfix

Postfixes the NODE_ENV when not production. Useful for dynamodb table names, etc.

const { envPostfix } = require('@compositor/util')

envPostfix('foobar') // => 'foobar-development'
auth

This can be used to authenticate a request against the user table.

const auth = require('@compositor/util/auth')

auth(req)
  .then(doStuff)
  .catch(handleUnauth)

license

MIT

contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request

Crafted with by (@getcompositor).

0.3.2

6 years ago

0.3.1

6 years ago

0.3.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago