random-objectid

v0.0.5
Generate a 12 byte hexadecimal string that can act as a mongo ObjectID
mongo objectid test

random-objectid

Returns a Promise that will resolve to a random 12 byte hex string.

Install

In a project:

npm install --save-dev random-objectid

Globally:

npm install --global random-objectid

Usage

In code:

const randomObjectId = require('random-objectid')

() => {
  const testId = randomObjectId()
  console.log('generated random id', testId)
}

From CLI:

$ random-objectid
37bfc2ff43cfc1ef75abe9c3

License

MIT

Metadata

  • MIT
  • Whatever
  • Chance Hudson
  • released 4/18/2019

Downloads

Maintainers