0.0.1 • Published 7 years ago

word-salad v0.0.1

Weekly downloads
2
License
Apache-2.0
Repository
github
Last release
7 years ago

Word Salad

Human-centric unique identifers for use in place of numeric record locators, account IDs and so on.

Installation

Install Word Salad module from NPM:

npm install word-salad --save

Exploration

Output a random identifier:

mkWordSalad

That will return something like "jet typist" or "indefinable sugarloaf".

To do that programmatically:

console.log(require('word-salad').mkID());

Map From Existing Numeric Identifiers

const wordSalad = require('word-salad');
const person = {id:101, name:'Sue'}
person.id = wordSalad.fromInt(person.id);

Map To Numeric Identifiers

const wordSalad = require('word-salad');
const person = {id:'inimical pizzicato', name:'Sue'}
person.id = wordSalad.toInt(person.id);

Generate A Sequence of Identifiers

const wordSalad = require('word-salad');
for(let i = 0; i < 100; ++i) {
  console.log(wordSalad.nextID());
}