
Security News
The Hidden Blast Radius of the Axios Compromise
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.
<script src="/path/to/UniqueIds.min.js"></script>
npm install uniqueids
let uid = require('uniqueids')
//Usage without name
uid()
//out:'$-VM9F6ROYU8J9MZ0S2Y.0'
//Batch usage
console.log(uid())
console.log(uid())
console.log(uid())
console.log(uid())
//out:
//$-27S1JC2Z2BXJ9MXTQFO.0
//$-9GTXYPGVY6J9MXTQFO.1
//$-4EV7QGEQSBYJ9MXTQFO.2
//$-A9F825VM43EJ9MXTQFO.3
//Usage with name
uid('xxx')
//out:'$xxx-MF0ZV3YWRNJ9MZ2CWX.0'
uid('aaa')
//out:'$aaa-WIJS1QWU1SJ9MZ2FMX.0'
//Batch usage with name
console.log(uid('xxx'))
console.log(uid('xxx'))
console.log(uid('aaa'))
console.log(uid('aaa'))
//out:
//$xxx-7QPHK93FGD7J9MZ4WMR.0
//$xxx-R7L4ZDY8CXRJ9MZ4WMR.1
//$aaa-OXLFBCZSAJ9MZ4WMS.0
//$aaa-0WC22S6JO229J9MZ4WMS.1
uid.$CountMode = true
console.log(uid())
console.log(uid())
//out:
//$-1
//$-2
uid.$Namer = (v) => {
return `Name:${v}>`
}
console.log(uid())
//out:
//Name:$->8LCBQBC5WFEJ9NRU9T8.1
uid.$Processor = (v) => {
return v.toLowerCase()
}
console.log(uid())
//out:
//$-3ivv71g6c9jj9nru9tb.0
uid.$Validator = (v) => {
return `Id:[${v}]`
}
console.log(uid())
//out:
//Id:[$-Z6V1L57ICRJ9NRU9T6.0]
uid.$Prefix '#'
console.log(uid())
//out:
//#-9Z9QBEH17PTJ9NRU9T9.0
uid.$Suffix '_'
console.log(uid())
//out:
//$_B51IXY4J0TUJ9NRU9T9.1
Get a UniqueId
Name:String )Get a named UniqueId
Reset all
Name:String )Reset Id by name
Name:String , Options:{ } )Init a Id
This is not necessary
Options:{
CountMode: Boolean, //set true to use Count Mode / set false to ignore global setting
prefix: String,
suffix: String
Namer: Function,
Processor: Function,
Validator: Function
}
Name:String , Options:{ } )Set Id's Options
Options as above
FAQs
Generate unique ID
The npm package uniqueids receives a total of 0 weekly downloads. As such, uniqueids popularity was classified as not popular.
We found that uniqueids demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
The Axios compromise shows how time-dependent dependency resolution makes exposure harder to detect and contain.

Research
A supply chain attack on Axios introduced a malicious dependency, plain-crypto-js@4.2.1, published minutes earlier and absent from the project’s GitHub releases.

Research
Malicious versions of the Telnyx Python SDK on PyPI delivered credential-stealing malware via a multi-stage supply chain attack.