diff options
| author | Shinigami <[email protected]> | 2022-01-18 20:10:01 +0100 |
|---|---|---|
| committer | GitHub <[email protected]> | 2022-01-18 20:10:01 +0100 |
| commit | ccf119deeb6c6d4c942544d83b515cddc5681ba3 (patch) | |
| tree | 0d7fa2d7ba58729a576d0eff0a32695f0113116a /examples/node/unique-values.js | |
| parent | 3c90061a6d6c334d0c653b55939d648774a6b5d4 (diff) | |
| download | faker-ccf119deeb6c6d4c942544d83b515cddc5681ba3.tar.xz faker-ccf119deeb6c6d4c942544d83b515cddc5681ba3.zip | |
feat!: support tree-shaking (#152)
Diffstat (limited to 'examples/node/unique-values.js')
| -rw-r--r-- | examples/node/unique-values.js | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/examples/node/unique-values.js b/examples/node/unique-values.js index 3c346612..bdbf5edf 100644 --- a/examples/node/unique-values.js +++ b/examples/node/unique-values.js @@ -1,19 +1,18 @@ -var faker = require('../../index'); +var faker = require('../../lib').faker; var emails = {}; var conflicts = 0; // emails estimated: 1,055,881 // full names estimated: 1,185,139 for (var i = 0; i < 100000; i++) { - // call function with no arguments var email = faker.unique(faker.internet.email); // or with function arguments as argument array - // var email = faker.unique(faker.internet.email, [null, null, 'marak.com']); + // var email = faker.unique(faker.internet.email, [null, null, 'marak.com']); // or with custom options for maxTime as milliseconds or maxRetries - // var email = faker.unique(faker.internet.email, [null, null, 'marak.com'], { maxRetries: 1, maxTime: 50 }); + // var email = faker.unique(faker.internet.email, [null, null, 'marak.com'], { maxRetries: 1, maxTime: 50 }); if (typeof emails[email] === 'undefined') { // found a unique new item @@ -26,4 +25,4 @@ for (var i = 0; i < 100000; i++) { console.log('total conflicts', conflicts); // should be zero using faker.unique() console.log('total uniques generated', Object.keys(emails).length); -// console.log(emails);
\ No newline at end of file +// console.log(emails); |
