Skip to content

Daiki48/ranval

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Ranval

Generates random value.

Usage

generateRanInt

import { generateRanInt } from "@daiki48/ranval";

console.log(generateRanInt(3));
// Output : Generate a random 3-digit integer.

generateRanString

import { generateRanString } from "@daiki48/ranval";

console.log("Default output : ", generateRanString(3));
// Output : Generate a random string.

console.log("Set upperCase : ", generateRanString(3, { upperCase: true }));
// Output : Generate a random string include upperCase.

console.log("Set numberCase : ", generateRanString(3, { numberCase: true }));
// Output : Generate a random string include numberCase.

console.log(
  "Set all options : ",
  generateRanString(3, { uppoerCase: true, numberCase: true })
);
// Output : Generate a random string include upperCase and numberCase.

console.log(
  "Set all options disabled : ",
  generateRanString(3, {
    lowerCase: false,
    upperCase: false,
    numberCase: false,
  })
);
// Output : Generate a random string include lowerCase and upperCase and numberCase.

LICENSE

MIT

Releases

No releases published