diff options
author | Minteck <contact@minteck.org> | 2021-12-21 16:52:28 +0100 |
---|---|---|
committer | Minteck <contact@minteck.org> | 2021-12-21 16:52:28 +0100 |
commit | 46e43f4bde4a35785b4997b81e86cd19f046b69b (patch) | |
tree | c53c2f826f777f9d6b2d249dab556feb72a6c3a6 /src/node_modules/chance/docs/usage/node.md | |
download | langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.gz langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.tar.bz2 langdetect-46e43f4bde4a35785b4997b81e86cd19f046b69b.zip |
Commit
Diffstat (limited to 'src/node_modules/chance/docs/usage/node.md')
-rw-r--r-- | src/node_modules/chance/docs/usage/node.md | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/node_modules/chance/docs/usage/node.md b/src/node_modules/chance/docs/usage/node.md new file mode 100644 index 0000000..914fe87 --- /dev/null +++ b/src/node_modules/chance/docs/usage/node.md @@ -0,0 +1,31 @@ +# node + +It can also be used in [Node.js](http://nodejs.org) + +```bash +npm install chance +``` + +then in your app + +```js +// Load Chance +var Chance = require('chance'); + +// Instantiate Chance so it can be used +var chance = new Chance(); + +// Use Chance here. +var my_random_string = chance.string(); +``` + +As of version 0.5.5, the following is also offered as a convenience for getting +an instance of Chance + +```js +// Load and instantiate Chance +var chance = require('chance').Chance(); + +// Use Chance here. +var my_random_string = chance.string(); +``` |