Type definitions and tests for node random-string module

This commit is contained in:
Sam Saint-Pettersen
2015-07-15 10:10:32 +01:00
parent 5518db1fd9
commit e22b188d1b
2 changed files with 20 additions and 0 deletions
+11
View File
@@ -0,0 +1,11 @@
/// <reference path="random-string.d.ts" />
import randomString = require('random-string');
console.log(randomString());
console.log(randomString({
length: 20,
numeric: true,
letters: true,
special: true
}));
+9
View File
@@ -0,0 +1,9 @@
// Type definitions for random-string
// Project: https://github.com/valiton/node-random-string
// Definitions by: Sam Saint-Pettersen <https://github.com/stpettersens>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
declare module "random-string" {
function randomString(opts?: Object): string;
export = randomString;
}