1.5.2 • Published 9 years ago

agileid v1.5.2

Weekly downloads
3
License
ISC
Repository
github
Last release
9 years ago

agileid

generate agilemd identifiers

usage

var AgileId = require('agileid')

AgileId.create()
// => VOKLm0YfEhYAAAA9

AgileId.create('foo')
// => foo!VOKLm0YfEhYAAAA-

AgileId.cast('user', 'VOKLm0YfEhYAAAA9')
// => user!VOKLm0YfEhYAAAA9

api

type AgileId <: String

AgileId.create : (type? : String, fromId? : AgileId | ObjectId) => AgileId

note, passing in the fromId is deprecated. Use AgileId.cast instead. Only use AgileId.create when you are expecting to generate a completely new identifier.

AgileId.cast : (type? : String, AgileId | String | ObjectId) => AgileId

AgileId.parse : (String | AgileId) => {id: String, type: String?}

AgileId.format : ({id: String, type?: String}) => AgileId

AgileId.isValid : (input : Any) => Boolean

Returns true if input is a valid AgileId string.

AgileId.toHexString : (id : AgileId) => hex : String

Useful for converting AgileIds to ObjectIds. Note that AgileId type information is lost.

installation

$ npm install agileid

cli usage

> agileid
< VOKaxIFSYp7_AAHs

# typed ids
> agileid foo
< foo!VOKa3KhUgSP_AAB9

# cast from objectid
> agileid -- 54e29b00153dbf6e00000001
< VOKbABU9v24AAAAB

# cast from objectid with type
> agileid foo 54e29b00153dbf6e00000001
< foo!VOKbABU9v24AAAAB

running the tests

From package root:

$ npm install
$ npm test

contributors

license

ISC. (c) MMXV AgileMD

1.5.2

9 years ago

1.5.1

9 years ago

1.5.0

9 years ago

1.4.0

9 years ago

1.3.0

9 years ago

1.2.0

9 years ago

1.1.0

9 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.0

9 years ago