crip-names
Advanced tools
Comparing version 1.1.0 to 1.1.1
17
index.js
@@ -7,17 +7,12 @@ 'use strict'; | ||
var uniqueRandom = require('unique-random'); | ||
var uniqueRandomArray = require('unique-random-array'); | ||
var cripNames = require('./crip-names.json'); | ||
var diagnoses = require('./diagnoses.json'); | ||
var allRandom = uniqueRandom(0, cripNames.length, -1); | ||
var diagnosesRandom = uniqueRandom(0, diagnoses.length, -1); | ||
// Export variables | ||
exports.all = cripNames; | ||
exports.diagnoses = diagnoses; | ||
exports.allRandom = function () { | ||
return cripNames[allRandom()]; | ||
}; | ||
exports.diagnosesRandom = function () { | ||
return diagnoses[diagnosesRandom()]; | ||
} | ||
// Export functions | ||
exports.allRandom = uniqueRandomArray(cripNames); | ||
exports.diagnosesRandom = uniqueRandomArray(diagnoses); |
{ | ||
"name": "crip-names", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"description": "Get awesome crip names and diagnoses", | ||
@@ -18,6 +18,8 @@ "license": "MIT", | ||
"author": "Johnie Hjelm <johnie@hjelm.im> http://crip.io", | ||
"contributors": [{ | ||
"name": "crip", | ||
"email": "info@crip.se" | ||
}], | ||
"contributors": [ | ||
{ | ||
"name": "crip", | ||
"email": "info@crip.se" | ||
} | ||
], | ||
"engines": { | ||
@@ -52,7 +54,7 @@ "node": ">=0.10.0" | ||
"meow": "^2.1.0", | ||
"unique-random": "^1.0.0" | ||
"unique-random-array": "^1.0.0" | ||
}, | ||
"devDependencies": { | ||
"ava": "0.0.4" | ||
"ava": "^0.1.0" | ||
} | ||
} |
@@ -20,2 +20,5 @@ # crip-names [![Build Status](https://travis-ci.org/crip/crip-names.svg)](https://travis-ci.org/crip/crip-names) | ||
//=> Stephen Hawkings | ||
cripNames.diagnosesRandom(); | ||
//=> Duchennes | ||
``` | ||
@@ -31,2 +34,8 @@ | ||
### .diagnoses | ||
Type: `array` | ||
Small list of diagnoses and physical disabilities | ||
### .allRandom() | ||
@@ -38,3 +47,9 @@ | ||
### .diagnosesRandom() | ||
Type: `function` | ||
Random diagnoses. | ||
## CLI | ||
@@ -41,0 +56,0 @@ |
5221
86
85
+ Addedunique-random-array@^1.0.0
+ Addedunique-random-array@1.0.1(transitive)
- Removedunique-random@^1.0.0