Permalink
Browse files

[minor] Replace yeast with nanoid (#647)

Fixes #639
  • Loading branch information...
lpinca committed Apr 6, 2018
1 parent dcf9460 commit 9fdbb6913a2c0cbfa782a4ff368f556e3f7ed98a
Showing with 11 additions and 10 deletions.
  1. +5 −5 README.md
  2. +4 −3 package.json
  3. +2 −2 spark.js
View
@@ -159,12 +159,12 @@ The `pingInterval` option specifies the interval at which heartbeats are
transmitted. It is possible to completely disable the heartbeats by setting the
value of the `pingInterval` option to `false`.
The `idGenerator` option can be used to define a function which will be called
The `idGenerator` option can be used to define a function which will be called
to set each [`spark.id`](#sparkid). The generator function should return
a unique string each time it is invoked. If `idGenerator` is not defined, Primus
will try to use ids provided by the transformer. If the transformer does not
provide ids, Primus will use [yeast](https://github.com/unshiftio/yeast) to
generate `Spark` ids.
a unique string each time it is invoked. If `idGenerator` is not defined, Primus
will try to use ids provided by the transformer. If the transformer does not
provide ids, Primus will use [nanoid](https://github.com/ai/nanoid) to generate
`Spark` ids.
If you don't have a pre-existing server where you want or can attach your Primus
server to you can also use the `Primus.createServer` convenience method. The
View
@@ -58,9 +58,9 @@
"eventemitter3": "~3.0.0",
"forwarded-for": "~1.0.1",
"fusing": "~1.0.0",
"nanoid": "~1.0.2",
"setheader": "~0.0.4",
"ultron": "~1.1.0",
"yeast": "~0.1.2"
"ultron": "~1.1.0"
},
"devDependencies": {
"binary-pack": "~1.0.2",
@@ -92,7 +92,8 @@
"tick-tock": "~1.0.0",
"url-parse": "~1.3.0",
"uws": "~9.14.0",
"ws": "~5.1.0"
"ws": "~5.1.0",
"yeast": "~0.1.2"
},
"pre-commit": "test, integration"
}
View
@@ -4,9 +4,9 @@ var ParserError = require('./errors').ParserError
, log = require('diagnostics')('primus:spark')
, parse = require('querystring').parse
, forwarded = require('forwarded-for')
, nanoid = require('nanoid')
, Ultron = require('ultron')
, fuse = require('fusing')
, yeast = require('yeast')
, u2028 = /\u2028/g
, u2029 = /\u2029/g;
@@ -32,7 +32,7 @@ function Spark(primus, headers, address, query, id, request) {
, idgen = primus.options.idGenerator;
query = query || {};
id = idgen ? idgen() : (id || yeast());
id = idgen ? idgen() : (id || nanoid());
headers = headers || {};
address = address || {};
request = request || headers['primus::req::backup'];

0 comments on commit 9fdbb69

Please sign in to comment.