1.2.1 • Published 3 years ago
@saekitominaga/document-generate-id v1.2.1
Generate a unique ID in Document
Generate a unique ID in Document.
Demo
Examples
import DocumentGenerateId from '@saekitominaga/document-generate-id';
const documentGenerateId1 = new DocumentGenerateId();
documentGenerateId1.generate(); // e.g. GUaHJ6ao5m
const documentGenerateId2 = new DocumentGenerateId(8, {
alphalower: true,
alphaupper: false,
number: true,
symbol: '-_:.',
}, 'js-', 3);
documentGenerateId2.generate(); // e.g. js-7f3h1w:l
Constructor
new DocumentGenerateId(
length = 10,
charactorType = {
alphalower: true,
alphaupper: true,
number: true,
symbol: '',
},
prefix = '',
trialLimit = 10
)