node package manager
Stop writing boring code. Discover, share, and reuse within your team. Create a free org »

Cashew

Cashew - ID Generator for node.js

An ID generator which allows you generate IDs, and identify them based on their type.

Inspiration:

  • Facebook's graph API
  • MongoDB's ObjectIds

Example:

 
var cashew = require('cashew');
 
var userIDGenerator = cashew.generator('users');
 
var userId = userIDGenerator.uid();
 
console.log(cashew.key(userId)); //users