random-char
Advanced tools
Comparing version 0.0.0 to 1.0.0
{ | ||
"name": "random-char", | ||
"version": "0.0.0", | ||
"version": "1.0.0", | ||
"description": "Generate a random character.", | ||
"main": "index.js", | ||
"scripts": { | ||
"test": "echo \"Error: no test specified\" && exit 1" | ||
"lint": "jshint index.js", | ||
"pretest": "npm run lint", | ||
"test": "mocha -R spec", | ||
"test:cov": "rm -rf ./test/coverage && istanbul cover _mocha --dir ./test/coverage -- -R spec", | ||
"test:rpt": "npm run test:cov && coveralls < ./test/coverage/lcov.info", | ||
"prepublish": "npm test" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/bubkoo/random-char.git" | ||
"url": "git+https://github.com/mock-end/random-char.git" | ||
}, | ||
@@ -17,11 +22,26 @@ "keywords": [ | ||
"random", | ||
"randomly", | ||
"rand", | ||
"char", | ||
"character" | ||
], | ||
"author": "bubkoo", | ||
"license": "MIT", | ||
"author": { | ||
"name": "bubkoo", | ||
"email": "bubkoo.wy@gmail.com" | ||
}, | ||
"bugs": { | ||
"url": "https://github.com/bubkoo/random-char/issues" | ||
"url": "https://github.com/mock-end/random-char/issues" | ||
}, | ||
"homepage": "https://github.com/bubkoo/random-char#readme" | ||
"homepage": "https://github.com/mock-end/random-char#readme", | ||
"devDependencies": { | ||
"jshint": "^2.9.1", | ||
"chai": "^3.5.0", | ||
"coveralls": "^2.11.9", | ||
"istanbul": "^0.4.2", | ||
"mocha": "^2.4.5" | ||
}, | ||
"dependencies": { | ||
"random-natural": "^1.0.0" | ||
} | ||
} |
# random-char | ||
Generate a random character. | ||
> Generate a random character. | ||
[![MIT License](https://img.shields.io/badge/license-MIT_License-green.svg?style=flat-square)](https://github.com/mock-end/random-char/blob/master/LICENSE) | ||
[![build:?](https://img.shields.io/travis/mock-end/random-char/master.svg?style=flat-square)](https://travis-ci.org/mock-end/random-char) | ||
[![coverage:?](https://img.shields.io/coveralls/mock-end/random-char/master.svg?style=flat-square)](https://coveralls.io/github/mock-end/random-char) | ||
## Install | ||
``` | ||
$ npm install --save random-char | ||
``` | ||
## Usage | ||
```js | ||
var randomChar = require('random-char'); | ||
randomChar(); | ||
// => 'g' | ||
randomChar('upper'); | ||
// => 'M' | ||
randomChar('aeiou'); | ||
// => 'i' | ||
``` | ||
## API | ||
### randomChar(pool) | ||
Randomly pick a char from a pool. | ||
Preset pools: | ||
- `'lower'` - `'abcdefghijklmnopqrstuvwxyz'` | ||
- `'upper'` - `'ABCDEFGHIJKLMNOPQRSTUVWXYZ'` | ||
- `'number'` - `'0123456789'` | ||
- `'symbol'` - `'!@#$%^&*()[]'` | ||
Custom pool: `randomChar('something');` | ||
## Related | ||
- [random-integral](https://github.com/mock-end/random-integral) - Generate a random integer. | ||
- [random-natural](https://github.com/mock-end/random-natural) - Generate a random natural number. | ||
- [random-decimal](https://github.com/mock-end/random-decimal) - Generate a random decimal. | ||
- [random-index](https://github.com/mock-end/random-index) - Generate a random array-like index. | ||
- [random-hexadecimal](https://github.com/mock-end/random-hexadecimal) - Generate a random hexadecimal number. | ||
- [random-octal](https://github.com/mock-end/random-octal) - Generate a random octal. | ||
- [random-unicode](https://github.com/mock-end/random-unicode) - Generate a random unicode. | ||
- [random-bool](https://github.com/mock-end/random-bool) - Generate a random boolean (true/false). | ||
- [random-lorem](https://github.com/mock-end/random-lorem) - Generate a random world. | ||
- [random-title](https://github.com/mock-end/random-title) - Generate a random title. | ||
- [random-sentence](https://github.com/mock-end/random-sentence) - Generate a random sentence. | ||
- [random-paragraph](https://github.com/mock-end/random-paragraph) - Generate a random paragraph. | ||
- [random-tld](https://github.com/mock-end/random-tld) - Return a random tld. | ||
- [random-domains](https://github.com/mock-end/random-domains) - Generate a random domain name. | ||
- [random-uri](https://github.com/mock-end/random-uri.git) - Generate a random url. | ||
- [random-email](https://github.com/mock-end/random-email) - Generate a random email. | ||
- [random-lang](https://github.com/mock-end/random-lang) - Return a random language name. | ||
- [random-mobile](https://github.com/mock-end/random-mobile) - Generate a random chinese mobile phone number. | ||
- [random-zipcode](https://github.com/mock-end/random-zipcode) - Generate a random chinese zipcode. | ||
- [random-ipv4](https://github.com/mock-end/random-ipv4) - Generate a random ipv4 address. | ||
- [random-ipv6](https://github.com/mock-end/random-ipv6) - Generate a random ipv6 address. | ||
- [random-color](https://github.com/mock-end/random-color) - Generate a random color. | ||
## Contributing | ||
Pull requests and stars are highly welcome. | ||
For bugs and feature requests, please [create an issue](https://github.com/mock-end/random-char/issues/new). |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Empty package
Supply chain riskPackage does not contain any code. It may be removed, is name squatting, or the result of a faulty package publish.
Found 1 instance in 1 package
No tests
QualityPackage does not have any tests. This is a strong signal of a poorly maintained or low quality package.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
5764
4
13
0
81
0
1
5
+ Addedrandom-natural@^1.0.0
+ Addedcall-bind@1.0.8(transitive)
+ Addedcall-bind-apply-helpers@1.0.1(transitive)
+ Addedcall-bound@1.0.2(transitive)
+ Addedclamp@1.0.1(transitive)
+ Addeddefine-data-property@1.1.4(transitive)
+ Addeddunder-proto@1.0.0(transitive)
+ Addedes-define-property@1.0.1(transitive)
+ Addedes-errors@1.3.0(transitive)
+ Addedes-object-atoms@1.0.0(transitive)
+ Addedfunction-bind@1.1.2(transitive)
+ Addedget-intrinsic@1.2.6(transitive)
+ Addedgopd@1.2.0(transitive)
+ Addedhas-property-descriptors@1.0.2(transitive)
+ Addedhas-symbols@1.1.0(transitive)
+ Addedhas-tostringtag@1.0.2(transitive)
+ Addedhasown@2.0.2(transitive)
+ Addedis-function@1.0.2(transitive)
+ Addedis-nil@1.0.1(transitive)
+ Addedis-object@1.0.2(transitive)
+ Addedis-regex@1.2.1(transitive)
+ Addedis-symbol@1.1.1(transitive)
+ Addedmath-intrinsics@1.0.0(transitive)
+ Addedmax-safe-int@1.0.0(transitive)
+ Addedrandom-integral@1.0.3(transitive)
+ Addedrandom-natural@1.0.3(transitive)
+ Addedsafe-regex-test@1.1.0(transitive)
+ Addedset-function-length@1.2.2(transitive)
+ Addedto-integer@1.0.1(transitive)