@curateco/string-generator
v1.0.2
Published
Generate random length and character strings
Downloads
160
Keywords
Readme
Usage
Options
All values are optional, and can be used in any combination
{
length: 10,
upperCase: true,
lowerCase: true,
specialChar: true,
numbers: true,
strict: true,
excluded: ['#', '&']
};
Basic operation to get a 10 character lower case string.
const code = await generate();
Generate string lower case 15 letters
const options = {
length: 15,
};
const code = await generate(options);
Generate string upper case case 15 letters
const options = {
length: 15,
upperCase:true
};
const code = await generate(options);
Generate 15 character string with lower case, upper case, and special characters required
const options = {
length: 15,
upperCase:true
lowerCase: true,
specialChar: true,
strict: true
};
const code = await generate(options);
Generate default length string with lower case, upper case, and special characters required, but with specific characters removed
const options = {
length: 15,
upperCase:true
lowerCase: true,
specialChar: true,
strict: true,
excluded: ['*', '$', '#']
};
const code = await generate(options);
Generate default length string with lower case, upper case, and special characters required, that has save characters for urls
const options = {
length: 15,
upperCase:true
lowerCase: true,
specialChar: true,
strict: true,
excluded: 'urlSafeChars'
};
const code = await generate(options);
Generate multiple strings
const options = {
length: 15,
upperCase:true
lowerCase: true,
specialChar: true,
strict: true,
excluded: ['*', '$', '#']
};
const amount = 3
const codes = await generateMultiple(amount, options)