ulid / javascript

Universally Unique Lexicographically Sortable Identifier
MIT License
3.04k stars 107 forks source link

Command line interface #25

Closed adius closed 7 years ago

adius commented 7 years ago

It would be cool if you could add a cli so one can call $ ulid on the command line.

jdanford commented 7 years ago

The JS implementation is pretty minimal – what about opening this issue for a different implementation like oklog/ulid?

adius commented 7 years ago

I think the JS version is really easy to install via npm / yarn. That's why it's a good place for the cli. My workaround at the moment is this script:

#! /usr/bin/env node

const ulid = require('/Users/adrian/.config/yarn/global/node_modules/ulid')
const value = ulid()

process.stdout.write(value.toLowerCase())
jdanford commented 7 years ago

Good point, ease of installation is important! It wouldn't be hard for you to turn that script into a CLI, according to the NPM docs.

adius commented 7 years ago

I could do. Will it be merged @alizain ?

alizain commented 7 years ago

Yep, a CLI is totally fine, I'd be happy to accept a PR for it.