{"name":"randomatic","description":"Generate randomized strings of a specified length, fast. Only the length is necessary, but you can optionally generate patterns using any combination of numeric, alpha-numeric, alphabetical, special or custom characters.","version":"1.1.5","homepage":"https://github.com/jonschlinkert/randomatic","author":{"name":"Jon Schlinkert","url":"https://github.com/jonschlinkert"},"repository":{"type":"git","url":"git+https://github.com/jonschlinkert/randomatic.git"},"bugs":{"url":"https://github.com/jonschlinkert/randomatic/issues"},"license":"MIT","files":["index.js"],"main":"index.js","scripts":{"test":"mocha"},"dependencies":{"is-number":"^2.0.2","kind-of":"^3.0.2"},"devDependencies":{"ansi-bold":"^0.1.1","benchmarked":"^0.1.4","glob":"^5.0.15","mocha":"*","should":"*"},"keywords":["alpha","alpha-numeric","alphanumeric","characters","chars","numeric","rand","random","randomize","randomized"],"verb":{"related":{"list":["repeat-string","pad-left","pad-right"]},"plugins":["gulp-format-md"]},"gitHead":"8d74759d683a580412484e95ec5f1b87d93fd50c","_id":"randomatic@1.1.5","_shasum":"5e9ef5f2d573c67bd2b8124ae90b5156e457840b","_from":".","_npmVersion":"3.3.6","_nodeVersion":"5.0.0","_npmUser":{"name":"jonschlinkert","email":"github@sellside.com"},"maintainers":[{"name":"jonschlinkert","email":"github@sellside.com"}],"dist":{"shasum":"5e9ef5f2d573c67bd2b8124ae90b5156e457840b","tarball":"http://registry-npm.ywwl.com/randomatic/download/randomatic-1.1.5.tgz","integrity":"sha512-j1W5ywGPhHEVyKZHrqJOVZezjdCDmEgqqIkwCQjp609Lz7mBAQZ0V80dgeI2lssTztid9c4otEy/I43g0vNFpg==","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEQCIFMD9Ixq+NWL2eoJusrEm12dgf0zOOKY48Cy5Mchqy7IAiBlzo0UUYPOAjuRJCkIJYi/qR6ZtanW8R2SuH8+5nXWeQ=="}],"size":3537,"noattachment":false,"key":"/randomatic/-/randomatic-1.1.5.tgz"},"directories":{},"readme":"# randomatic [![NPM version](https://img.shields.io/npm/v/randomatic.svg?style=flat)](https://www.npmjs.com/package/randomatic) [![NPM monthly downloads](https://img.shields.io/npm/dm/randomatic.svg?style=flat)](https://npmjs.org/package/randomatic) [![NPM total downloads](https://img.shields.io/npm/dt/randomatic.svg?style=flat)](https://npmjs.org/package/randomatic) [![Linux Build Status](https://img.shields.io/travis/jonschlinkert/randomatic.svg?style=flat&label=Travis)](https://travis-ci.org/jonschlinkert/randomatic)\n\n> Generate randomized strings of a specified length using simple character sequences. The original generate-password.\n\nPlease consider following this project's author, [Jon Schlinkert](https://github.com/jonschlinkert), and consider starring the project to show your :heart: and support.\n\n## Install\n\nInstall with [npm](https://www.npmjs.com/):\n\n```sh\n$ npm install --save randomatic\n```\n\n## Usage\n\n```js\nvar randomize = require('randomatic');\n```\n\n## API\n\n```js\nrandomize(pattern, length, options);\nrandomize.isCrypto;\n```\n\n* `pattern` **{String}**: (required) The pattern to use for randomizing\n* `length` **{Number}**: (optional) The length of the string to generate\n* `options` **{Object}**: (optional) See available [options](#options)\n* `randomize.isCrypto` will be `true` when a cryptographically secure function is being used to generate random numbers. The value will be `false` when the function in use is `Math.random`.\n\n### pattern\n\n> The pattern to use for randomizing\n\nPatterns can contain any combination of the below characters, specified in any order.\n\n**Example:**\n\nTo generate a 10-character randomized string using all available characters:\n\n```js\nrandomize('*', 10);\n//=> 'x2_^-5_T[$'\n\nrandomize('Aa0!', 10);\n//=> 'LV3u~BSGhw'\n```\n\n* `a`: Lowercase alpha characters (`abcdefghijklmnopqrstuvwxyz'`)\n* `A`: Uppercase alpha characters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ'`)\n* `0`: Numeric characters (`0123456789'`)\n* `!`: Special characters (`~!@#$%^&()_+-={}[];\\',.`)\n* `*`: All characters (all of the above combined)\n* `?`: Custom characters (pass a string of custom characters to the options)\n\n### length\n\n> The length of the string to generate\n\n**Examples:**\n\n* `randomize('A', 5)` will generate a 5-character, uppercase, alphabetical, randomized string, e.g. `KDJWJ`.\n* `randomize('0', 2)` will generate a 2-digit random number\n* `randomize('0', 3)` will generate a 3-digit random number\n* `randomize('0', 12)` will generate a 12-digit random number\n* `randomize('A0', 16)` will generate a 16-character, alpha-numeric randomized string\n\nIf `length` is left undefined, the length of the pattern in the first parameter will be used. For example:\n\n* `randomize('00')` will generate a 2-digit random number\n* `randomize('000')` will generate a 3-digit random number\n* `randomize('0000')` will generate a 4-digit random number...\n* `randomize('AAAAA')` will generate a 5-character, uppercase alphabetical random string...\n\nThese are just examples, [see the tests](./test.js) for more use cases and examples.\n\n## options\n\n> These are options that can be passed as the third argument.\n\n#### chars\n\nType: `String`\n\nDefault: `undefined`\n\nDefine a custom string to be randomized.\n\n**Example:**\n\n* `randomize('?', 20, {chars: 'jonschlinkert'})` will generate a 20-character randomized string from the letters contained in `jonschlinkert`.\n* `randomize('?', {chars: 'jonschlinkert'})` will generate a 13-character randomized string from the letters contained in `jonschlinkert`.\n\n#### exclude\n\nType: `String|Array`\n\nDefault: `undefined`\n\nSpecify a string or array of characters can are excluded from the possible characters used to generate the randomized string.\n\n**Example:**\n\n* `randomize('*', 20, { exclude: '0oOiIlL1' })` will generate a 20-character randomized string using all of possible characters except for `0oOiIlL1`.\n\n## Usage Examples\n\n* `randomize('A', 4)` (_whitespace insenstive_) would result in randomized 4-digit uppercase letters, like, `ZAKH`, `UJSL`... etc.\n* `randomize('AAAA')` is equivelant to `randomize('A', 4)`\n* `randomize('AAA0')` and `randomize('AA00')` and `randomize('A0A0')` are equivelant to `randomize('A0', 4)`\n* `randomize('aa')`: results in double-digit, randomized, lower-case letters (`abcdefghijklmnopqrstuvwxyz`)\n* `randomize('AAA')`: results in triple-digit, randomized, upper-case letters (`ABCDEFGHIJKLMNOPQRSTUVWXYZ`)\n* `randomize('0', 6)`: results in six-digit, randomized numbers (`0123456789`)\n* `randomize('!', 5)`: results in single-digit randomized, _valid_ non-letter characters (`~!@#$%^&()_+-={}[]\n* `randomize('A!a0', 9)`: results in nine-digit, randomized characters (any of the above)\n\n_The order in which the characters are defined is insignificant._\n\n## About\n\n<details>\n<summary><strong>Contributing</strong></summary>\n\nPull requests and stars are always welcome. For bugs and feature requests, [please create an issue](../../issues/new).\n\n</details>\n\n<details>\n<summary><strong>Running Tests</strong></summary>\n\nRunning and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:\n\n```sh\n$ npm install && npm test\n```\n\n</details>\n\n<details>\n<summary><strong>Building docs</strong></summary>\n\n_(This project's readme.md is generated by [verb](https://github.com/verbose/verb-generate-readme), please don't edit the readme directly. Any changes to the readme must be made in the [.verb.md](.verb.md) readme template.)_\n\nTo generate the readme, run the following command:\n\n```sh\n$ npm install -g verbose/verb#dev verb-generate-readme && verb\n```\n\n</details>\n\n### Related projects\n\nYou might also be interested in these projects:\n\n* [pad-left](https://www.npmjs.com/package/pad-left): Left pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-left \"Left pad a string with zeros or a specified string. Fastest implementation.\")\n* [pad-right](https://www.npmjs.com/package/pad-right): Right pad a string with zeros or a specified string. Fastest implementation. | [homepage](https://github.com/jonschlinkert/pad-right \"Right pad a string with zeros or a specified string. Fastest implementation.\")\n* [repeat-string](https://www.npmjs.com/package/repeat-string): Repeat the given string n times. Fastest implementation for repeating a string. | [homepage](https://github.com/jonschlinkert/repeat-string \"Repeat the given string n times. Fastest implementation for repeating a string.\")\n\n### Contributors\n\n| **Commits** | **Contributor** |  \n| --- | --- |  \n| 56 | [jonschlinkert](https://github.com/jonschlinkert) |  \n| 6  | [doowb](https://github.com/doowb) |  \n| 4  | [kivlor](https://github.com/kivlor) |  \n| 2  | [realityking](https://github.com/realityking) |  \n| 2  | [ywpark1](https://github.com/ywpark1) |  \n| 1  | [TrySound](https://github.com/TrySound) |  \n| 1  | [drag0s](https://github.com/drag0s) |  \n| 1  | [paulmillr](https://github.com/paulmillr) |  \n| 1  | [sunknudsen](https://github.com/sunknudsen) |  \n| 1  | [faizulhaque-tp](https://github.com/faizulhaque-tp) |  \n| 1  | [michaelrhodes](https://github.com/michaelrhodes) |  \n\n### Author\n\n**Jon Schlinkert**\n\n* [GitHub Profile](https://github.com/jonschlinkert)\n* [Twitter Profile](https://twitter.com/jonschlinkert)\n* [LinkedIn Profile](https://linkedin.com/in/jonschlinkert)\n\n### License\n\nCopyright © 2018, [Jon Schlinkert](https://github.com/jonschlinkert).\nReleased under the [MIT License](LICENSE).\n\n***\n\n_This file was generated by [verb-generate-readme](https://github.com/verbose/verb-generate-readme), v0.8.0, on October 23, 2018._","publish_time":1449774821356,"_cnpm_publish_time":1449774821356,"dist-tags":{"latest":"3.1.1"}}