forfuture-dev/node-sequential-ids — pull request #1 by andrefs (2014-10-22 19:56:41+00:00)
Title: Multiple keys in 1 generator

I added support for generating multiple distinct IDs using one generator. This saves you the trouble of having to open one generator in a distinct port for each type of ID you want to be generating.

Basically you can pass a **key** parameter to `Generator.generate()` or to `Accessor.next()`, to generate an ID for that key. There's a new method, `Generator.add(key, options)` which adds a new key to the generator.

Internally, everything is kept in a `keys` object; all `options` are relative to each key, except for **port**.

No API breaks: all previous methods can still be used because a **'__default'** key is always added to the Generator (when it is initialized) which is used when the **key** parameter is omitted.

I updated the docs and tests, let me know if there's anything else I can do in order to have this merged.