0.1.4 • Published 10 years ago
ember-simple-uuid v0.1.4
ember-simple-uuid
Direct client-side UUID generation that exposes node-uuid's uuid.v4 implementation as an importable module.
Original credit for this addon's approach is due to ember-cli-uuid. ember-simple-uuid wraps the same function -- but without any dependency on ember-data or initializer decoration of DS.Adapter. Those wanting such extra behavior may well want to give ember-cli-uuid a look.
ember-simple-uuid also gathers any arguments passed to its function and spreads them to fit the uuid.v4 function signature. This enables the configuration options documented here.
Usage
Straight up:
import uuid from 'ember-simple-uuid';
const babyName = uuid();
// babyName >> 'ad84fb10-19c4-01e1-2b0d-7b25c4ea062'With arguments -- for example, generating two IDs in a single buffer:
import uuid from 'ember-simple-uuid';
const myDigits = new Array(32);
uuid(null, myDigits, 0);
uuid(null, myDigits, 16);Building Locally
Installation
git clonethis repositorynpm installbower install
Running
ember server- Visit your app at http://localhost:4200.
Running Tests
npm test(Runsember try:testallto test your addon against multiple Ember versions)ember testember test --server
Building
ember build
For more information on using ember-cli, visit http://www.ember-cli.com/.