Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/npm/cli.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRebecca Turner <me@re-becca.org>2018-05-24 23:31:26 +0300
committerRebecca Turner <me@re-becca.org>2018-05-24 23:31:38 +0300
commit0483f5c5deaf18c968a128657923103e49f4e67a (patch)
tree210f154da2f60938471d96a844dcb32cbda09e2a /node_modules/unique-slug
parent6c294614d800cb95a49ef1c422fbdde65b0731a2 (diff)
Flatten dependencies and add dev deps to git
Diffstat (limited to 'node_modules/unique-slug')
-rw-r--r--node_modules/unique-slug/.npmignore6
-rw-r--r--node_modules/unique-slug/.travis.yml11
-rw-r--r--node_modules/unique-slug/README.md20
-rw-r--r--node_modules/unique-slug/index.js19
-rw-r--r--node_modules/unique-slug/package.json56
-rw-r--r--node_modules/unique-slug/test/index.js13
6 files changed, 125 insertions, 0 deletions
diff --git a/node_modules/unique-slug/.npmignore b/node_modules/unique-slug/.npmignore
new file mode 100644
index 000000000..2833ae874
--- /dev/null
+++ b/node_modules/unique-slug/.npmignore
@@ -0,0 +1,6 @@
+*~
+.#*
+DEADJOE
+
+node_modules
+.nyc_output/
diff --git a/node_modules/unique-slug/.travis.yml b/node_modules/unique-slug/.travis.yml
new file mode 100644
index 000000000..3bc5d90c5
--- /dev/null
+++ b/node_modules/unique-slug/.travis.yml
@@ -0,0 +1,11 @@
+language: node_js
+sudo: false
+before_install:
+ - "npm -g install npm"
+node_js:
+ - "0.8"
+ - "0.10"
+ - "0.12"
+ - "iojs"
+ - "4"
+ - "5"
diff --git a/node_modules/unique-slug/README.md b/node_modules/unique-slug/README.md
new file mode 100644
index 000000000..52de4277d
--- /dev/null
+++ b/node_modules/unique-slug/README.md
@@ -0,0 +1,20 @@
+unique-slug
+===========
+
+Generate a unique character string suitible for use in files and URLs.
+
+```
+var uniqueSlug = require('unique-slug')
+
+var randomSlug = uniqueSlug()
+var fileSlug = uniqueSlug('/etc/passwd')
+```
+
+### uniqueSlug(*str*) → String (8 chars)
+
+If *str* is passed in then the return value will be its murmur hash in
+hex.
+
+If *str* is not passed in, it will be 4 bytes coverted into 8 hex
+characters, generated by `crypto.pseudoRandomBytes`.
+
diff --git a/node_modules/unique-slug/index.js b/node_modules/unique-slug/index.js
new file mode 100644
index 000000000..7c5d6c751
--- /dev/null
+++ b/node_modules/unique-slug/index.js
@@ -0,0 +1,19 @@
+'use strict'
+var crypto = require('crypto')
+var MurmurHash3 = require('imurmurhash')
+
+module.exports = function (uniq) {
+ if (uniq) {
+ var hash = new MurmurHash3(uniq)
+ return ('00000000' + hash.result().toString(16)).substr(-8)
+ } else {
+ // Called without a callback, because this interface should neither block
+ // nor error (by contrast with randomBytes which will throw an exception
+ // without enough entropy).
+ //
+ // However, due to a change in Node 0.10.27+, pseudoRandomBytes is now the
+ // same as randomBytes, and may in fact block in situations where
+ // insufficent entropy is available.
+ return crypto.pseudoRandomBytes(4).toString('hex')
+ }
+}
diff --git a/node_modules/unique-slug/package.json b/node_modules/unique-slug/package.json
new file mode 100644
index 000000000..fb5e08b61
--- /dev/null
+++ b/node_modules/unique-slug/package.json
@@ -0,0 +1,56 @@
+{
+ "_from": "unique-slug@^2.0.0",
+ "_id": "unique-slug@2.0.0",
+ "_inBundle": false,
+ "_integrity": "sha1-22Z258fMBimHj/GWCXx4hVrp9Ks=",
+ "_location": "/unique-slug",
+ "_phantomChildren": {},
+ "_requested": {
+ "type": "range",
+ "registry": true,
+ "raw": "unique-slug@^2.0.0",
+ "name": "unique-slug",
+ "escapedName": "unique-slug",
+ "rawSpec": "^2.0.0",
+ "saveSpec": null,
+ "fetchSpec": "^2.0.0"
+ },
+ "_requiredBy": [
+ "/unique-filename"
+ ],
+ "_resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.0.tgz",
+ "_shasum": "db6676e7c7cc0629878ff196097c78855ae9f4ab",
+ "_spec": "unique-slug@^2.0.0",
+ "_where": "/Users/rebecca/code/npm/node_modules/unique-filename",
+ "author": {
+ "name": "Rebecca Turner",
+ "email": "me@re-becca.org",
+ "url": "http://re-becca.org"
+ },
+ "bugs": {
+ "url": "https://github.com/iarna/unique-slug/issues"
+ },
+ "bundleDependencies": false,
+ "dependencies": {
+ "imurmurhash": "^0.1.4"
+ },
+ "deprecated": false,
+ "description": "Generate a unique character string suitible for use in files and URLs.",
+ "devDependencies": {
+ "standard": "^5.4.1",
+ "tap": "^2.3.1"
+ },
+ "homepage": "https://github.com/iarna/unique-slug#readme",
+ "keywords": [],
+ "license": "ISC",
+ "main": "index.js",
+ "name": "unique-slug",
+ "repository": {
+ "type": "git",
+ "url": "git://github.com/iarna/unique-slug.git"
+ },
+ "scripts": {
+ "test": "standard && tap --coverage test"
+ },
+ "version": "2.0.0"
+}
diff --git a/node_modules/unique-slug/test/index.js b/node_modules/unique-slug/test/index.js
new file mode 100644
index 000000000..0f4ccad04
--- /dev/null
+++ b/node_modules/unique-slug/test/index.js
@@ -0,0 +1,13 @@
+'use strict'
+var t = require('tap')
+var uniqueSlug = require('../index.js')
+
+t.plan(5)
+var slugA = uniqueSlug()
+t.is(slugA.length, 8, 'random slugs are 8 chars')
+t.notEqual(slugA, uniqueSlug(), "two slugs aren't the same")
+var base = '/path/to/thingy'
+var slugB = uniqueSlug(base)
+t.is(slugB.length, 8, 'string based slugs are 8 chars')
+t.is(slugB, uniqueSlug(base), 'two string based slugs, from the same string are the same')
+t.notEqual(slugB, uniqueSlug(slugA), 'two string based slongs, from diff strings are different')