flake (GitHub: chilts/flake, License: MIT) can generate practically unique
approximately sortable IDs in a distributed environment, similiar to
Twitter’s Snowflake.

npm install flake

Use in distributed environments where you don’t have a central service
which can be a single point of failure – perfect when you want
everything to be redundant and independent of each other. Flake Id is
made up of timestamp-counter-pid-macaddress

> var flake = require('flake')('eth0');
> console.log(flake());
> console.log(flake());
> console.log(flake());

In the example above, eth0 is used for machine’s network interface,
but this is not guaranteed to work on your machine. You need to change
it to something which exists on your machine. It’s easy to find it on
your machine using ifconfig or something similiar.

There are plenty of examples and information on the
github page.