package.json 5.4 KB
{
  "_args": [
    [
      {
        "raw": "yeast@0.1.2",
        "scope": null,
        "escapedName": "yeast",
        "name": "yeast",
        "rawSpec": "0.1.2",
        "spec": "0.1.2",
        "type": "version"
      },
      "/Users/fzy/project/3mang/node_modules/engine.io-client"
    ]
  ],
  "_from": "yeast@0.1.2",
  "_id": "yeast@0.1.2",
  "_inCache": true,
  "_location": "/yeast",
  "_nodeVersion": "0.12.3",
  "_npmUser": {
    "name": "3rdeden",
    "email": "npm@3rd-Eden.com"
  },
  "_npmVersion": "2.9.1",
  "_phantomChildren": {},
  "_requested": {
    "raw": "yeast@0.1.2",
    "scope": null,
    "escapedName": "yeast",
    "name": "yeast",
    "rawSpec": "0.1.2",
    "spec": "0.1.2",
    "type": "version"
  },
  "_requiredBy": [
    "/engine.io-client"
  ],
  "_resolved": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz",
  "_shasum": "008e06d8094320c372dbc2f8ed76a0ca6c8ac419",
  "_shrinkwrap": null,
  "_spec": "yeast@0.1.2",
  "_where": "/Users/fzy/project/3mang/node_modules/engine.io-client",
  "author": {
    "name": "Arnout Kazemier"
  },
  "bugs": {
    "url": "https://github.com/unshiftio/yeast/issues"
  },
  "dependencies": {},
  "description": "Tiny but linear growing unique id generator",
  "devDependencies": {
    "assume": "1.3.x",
    "istanbul": "0.3.x",
    "mocha": "2.3.x",
    "pre-commit": "1.1.x",
    "zuul": "3.4.x"
  },
  "directories": {},
  "dist": {
    "shasum": "008e06d8094320c372dbc2f8ed76a0ca6c8ac419",
    "tarball": "https://registry.npmjs.org/yeast/-/yeast-0.1.2.tgz"
  },
  "gitHead": "5a7300f934302009aa8733fa84d43cc570756b98",
  "homepage": "https://github.com/unshiftio/yeast",
  "keywords": [
    "yeast",
    "id",
    "generator",
    "unique"
  ],
  "license": "MIT",
  "main": "index.js",
  "maintainers": [
    {
      "name": "unshift",
      "email": "npm@unshift.io"
    },
    {
      "name": "3rdeden",
      "email": "npm@3rd-Eden.com"
    }
  ],
  "name": "yeast",
  "optionalDependencies": {},
  "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",
  "repository": {
    "type": "git",
    "url": "git+https://github.com/unshiftio/yeast.git"
  },
  "scripts": {
    "100%": "istanbul check-coverage --statements 100 --functions 100 --lines 100 --branches 100",
    "coverage": "istanbul cover _mocha -- test.js",
    "test": "mocha test.js",
    "test-browser": "zuul -- test.js",
    "test-node": "istanbul cover _mocha --report lcovonly -- test.js",
    "watch": "mocha --watch test.js"
  },
  "version": "0.1.2"
}