UniqueIds
Installation
Browser
Node
npm install uniqueids
let uid =
Usage
//Usage without name//out:'$-VM9F6ROYU8J9MZ0S2Y.0'
//Batch usageconsoleconsoleconsoleconsole//out://$-27S1JC2Z2BXJ9MXTQFO.0//$-9GTXYPGVY6J9MXTQFO.1//$-4EV7QGEQSBYJ9MXTQFO.2//$-A9F825VM43EJ9MXTQFO.3
//Usage with name//out:'$xxx-MF0ZV3YWRNJ9MZ2CWX.0'//out:'$aaa-WIJS1QWU1SJ9MZ2FMX.0'
//Batch usage with nameconsoleconsoleconsoleconsole//out://$xxx-7QPHK93FGD7J9MZ4WMR.0//$xxx-R7L4ZDY8CXRJ9MZ4WMR.1//$aaa-OXLFBCZSAJ9MZ4WMS.0//$aaa-0WC22S6JO229J9MZ4WMS.1
Global options
CountMode
uid$CountMode = trueconsoleconsole//out://$-1//$-2
Middleware
- #### Namer
uid {return `Name:>`}console//out://Name:$->8LCBQBC5WFEJ9NRU9T8.1
- #### Processor
uid {return v}console//out://$-3ivv71g6c9jj9nru9tb.0
- #### Validator
uid {return `Id:[]`}console//out://Id:[$-Z6V1L57ICRJ9NRU9T6.0]
Prefix
uid$Prefix '#'console//out://#-9Z9QBEH17PTJ9NRU9T9.0
Suffix
uid$Suffix '_'console//out://$_B51IXY4J0TUJ9NRU9T9.1
Apis
uid( )
Get a UniqueId
Name
:String )
uid( Get a named UniqueId
uid.resetAll()
Reset all
Name
:String )
uid.reset( Reset Id by name
Name
:String , Options
:{ } )
uid.init( Init a Id
This is not necessary
Options:CountMode: Boolean //set true to use Count Mode / set false to ignore global settingprefix: Stringsuffix: StringNamer: FunctionProcessor: FunctionValidator: Function
Name
:String , Options
:{ } )
uid.set( Set Id's Options
Options as above