ai / nanoid

A tiny (124 bytes), secure, URL-friendly, unique string ID generator for JavaScript
https://zelark.github.io/nano-id-cc/
MIT License
24.34k stars 789 forks source link

Allows passing size or custom alphabet via cli as args #334

Closed vitalybaev closed 2 years ago

vitalybaev commented 2 years ago

Closes #275

I've implemented minimal args parsing logic to fit our needs and be as little as possible

ai commented 2 years ago

We need to improve test coverage. You can check test coverage locally by running pnpm test.

ai commented 2 years ago

We also need to fix Node.js 12 support for binary (we can’t use ??)

vitalybaev commented 2 years ago

Done

I've faced error ERROR dual-publish error: Rename bin/utils.js to bin/utils/index.js, so I moved file according to this message.

Now it still works with Node 12 and test coverage is 100%

ai commented 2 years ago

bin/utils will create unnecessary files because of dual-publish. I cleaned up arguments parsing a little https://github.com/ai/nanoid/commit/27eaa90cd207a7782bbcf17343092ae87dd62164

And released in 3.2.