Package Exports
- @raydeck/passcode
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@raydeck/passcode) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
passcode
Node.js passcode generator
Installation
yarn add @raydeck/passcodeUsage: makePasscode([length = 6], [characterset = "number"]): Promise
Return value
Promise for a string that contains the random passcode. Best used with async/await as in example below.
Arguments
length
How long to make the passcode. Must be positive integer. Defaults to 6
characterset
Key of an avaiable set of characters to randomly generate from. Available keys:
- number (digits 0-9)
- alphanumeric (lowercase letters plus numbers)
- loweralphanumeric (same as alphanumeric)
- upperalphanumeric (uppercase letters plus numbers)
- allalphanumeric (uppercase, lowercase and numbers - maximum entropy)
- lowercase (lowercase letters a-z)
- uppercase (uppercase letters a-z)
Defaults to "number".
Example
const makePasscode = require("@raydeck/passcode");
const sixDigitCode = await makePasscode();
const tenCharacterCode = await makePasscode(10, "alphanumeric");