npm.io
0.2.0 • Published 2 years ago

@types/random-string

Licence
MIT
Version
0.2.0
Deps
0
Size
5 kB
Vulns
0
Weekly
0
Stars
51.4K

Installation

npm install --save @types/random-string

Summary

This package contains type definitions for random-string (https://github.com/valiton/node-random-string).

Details

Files were exported from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/random-string.

index.d.ts

declare namespace randomString {
    interface RandomStringOptions {
        /**
         * The length of your resulting string
         * @default 8
         */
        length?: number | undefined;

        /**
         * Should your resulting string contain numbers
         * @default true
         */
        numeric?: boolean | undefined;

        /**
         * Should your resulting string contain letters (from a-z, lower and uppercase)
         * @default true
         */
        letters?: boolean | undefined;

        /**
         * Should your resulting string contain any of these special characters (!$%^&*()_+|~-=`{}[]:;<>?,./)
         * @default false
         */
        special?: boolean | undefined;

        /**
         * Removes characters from resulting string.
         * Note: Lowercase letters will not remove uppercase letters.
         * @default []
         */
        exclude?: string[] | undefined;
    }
}

declare function randomString(options?: randomString.RandomStringOptions): string;

export = randomString;

Additional Details

  • Last updated: Tue, 24 Sep 2024 1738 GMT
  • Dependencies: none

Credits

These definitions were written by Sam Saint-Pettersen.