The best package to create hash ids.
unique-hash
Useful for saving to
//or es5//var uniqueHash = require("unique-hash").defaultlet url = "https://www.npmjs.com/package/unique-hash" //>> output 88870086 //>> output 88870086 //>> output "iIIHaAIG" //>> output "iIIHaAIG" //>> output 983277668//>> output 983277668//>> output 983277668 //>> output "john-h-smith"//>> output "john-h-smith"//>> output "john-h-smith" //>> output "articles/2017/08/27/88870086" //>> output "articles/2017/08/hot/iIIHaAIG/videos"
Parameters
Parameter | Default | Description |
---|---|---|
format | "number" | options: "number", "string" or "kebabCase" |
prepend | "" | string to prepend output path |
append | "" | string to append output path |
appendDate | "" | string to center between date and hash id (eg. output /YYYY/MM/DD/[HERE]/:hashId ) |
date | n/a | pass in date to append /YYYY/MM/DD to save path |
dateFormate | "YYYY/MM/DD" | Date format |
hashId | n/a | override the output hashId, useful if you want to use with date. |