{
  "name": "yeast",
  "version": "0.1.2",
  "description": "Tiny but linear growing unique id generator",
  "main": "index.js",
  "scripts": {
    "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
    "test-node": "istanbul cover _mocha --report lcovonly -- test.js",
    "coverage": "istanbul cover _mocha -- test.js",
    "test-browser": "zuul -- test.js",
    "watch": "mocha --watch test.js",
    "test": "mocha test.js"
  },
  "repository": {
    "type": "git",
    "url": "https://github.com/unshiftio/yeast.git"
  },
  "keywords": [
    "yeast",
    "id",
    "generator",
    "unique"
  ],
  "author": {
    "name": "Arnout Kazemier"
  },
  "license": "MIT",
  "bugs": {
    "url": "https://github.com/unshiftio/yeast/issues"
  },
  "homepage": "https://github.com/unshiftio/yeast",
  "devDependencies": {
    "assume": "1.3.x",
    "istanbul": "0.3.x",
    "mocha": "2.3.x",
    "pre-commit": "1.1.x",
    "zuul": "3.4.x"
  },
  "readme": "# yeast\n\n[![Made by unshift](https://img.shields.io/badge/made%20by-unshift-00ffcc.svg?style=flat-square)](http://unshift.io)[![Version npm](https://img.shields.io/npm/v/yeast.svg?style=flat-square)](http://browsenpm.org/package/yeast)[![Build Status](https://img.shields.io/travis/unshiftio/yeast/master.svg?style=flat-square)](https://travis-ci.org/unshiftio/yeast)[![Dependencies](https://img.shields.io/david/unshiftio/yeast.svg?style=flat-square)](https://david-dm.org/unshiftio/yeast)[![Coverage Status](https://img.shields.io/coveralls/unshiftio/yeast/master.svg?style=flat-square)](https://coveralls.io/r/unshiftio/yeast?branch=master)[![IRC channel](https://img.shields.io/badge/IRC-irc.freenode.net%23unshift-00a8ff.svg?style=flat-square)](https://webchat.freenode.net/?channels=unshift)\n\n[![Sauce Test Status](https://saucelabs.com/browser-matrix/yeast.svg)](https://saucelabs.com/u/yeast)\n\nYeast is a unique id generator. It has been primarily designed to generate a\nunique id which can be used for cache busting. A common practice for this is\nto use a timestamp, but there are couple of downsides when using timestamps.\n\n1. The timestamp is already 13 chars long. This might not matter for 1 request\n   but if you make hundreds of them this quickly adds up in bandwidth and\n   processing time.\n2. It's not unique enough. If you generate two stamps right after each other,\n   they would be identical because the timing accuracy is limited to\n   milliseconds.\n\nYeast solves both of these issues by:\n\n1. Compressing the generated timestamp using a custom `encode()` function that\n   returns a string representation of the number.\n2. Seeding the id in case of collision (when the id is identical to the previous\n   one).\n\nTo keep the strings unique it will use the `.` char to separate the generated\nstamp from the seed.\n\n## Installation\n\nThe module is intended to be used in browsers as well as in Node.js and is\ntherefore released in the npm registry and can be installed using:\n\n```\nnpm install --save yeast\n```\n\n## Usage\n\nAll the examples assume that this library is initialized as follow:\n\n```js\n'use strict';\n\nvar yeast = require('yeast');\n```\n\nTo generate an id just call the `yeast` function.\n\n```js\nconsole.log(yeast(), yeast(), yeast()); // outputs: KyxidwN KyxidwN.0 KyxidwN.1\n\nsetTimeout(function () {\n  console.log(yeast()); // outputs: KyxidwO\n});\n```\n\n### yeast.encode(num)\n\nAn helper function that returns a string representing the specified number. The\nreturned string contains only URL safe characters.\n\n```js\nyeast.encode(+new Date()); // outputs: Kyxjuo1\n```\n\n### yeast.decode(str)\n\nAn helper function that returns the integer value specified by the given string.\nThis function can be used to retrieve the timestamp from a `yeast` id.\n\n```js\nvar id = yeast(); // holds the value: Kyxl1OU\n\nyeast.decode(id); // outputs: 1439816226334\n```\n\nThat's all folks. If you have ideas on how we can further compress the ids\nplease open an issue!\n\n## License\n\n[MIT](LICENSE)\n",
  "readmeFilename": "README.md",
  "_id": "yeast@0.1.2",
  "_shasum": "008e06d8094320c372dbc2f8ed76a0ca6c8ac419",
  "_from": "yeast@0.1.2",
  "_resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz"
}
