ember-simple-uuid

0.1.4 • Public • Published

ember-simple-uuid

npm version Build Status Ember Observer Score

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 clone this repository
  • npm install
  • bower install

Running

Running Tests

  • npm test (Runs ember try:testall to test your addon against multiple Ember versions)
  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.

Package Sidebar

Install

npm i ember-simple-uuid

Weekly Downloads

37

Version

0.1.4

License

MIT

Last publish

Collaborators

  • bsipple