blob: 914fe8786e0134ab60715af5eeb8fc904cfdd2f1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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();
```
|