Skip to content

ewandennis/word-salad

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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());
}

Releases

No releases published

Packages

No packages published