Ready to take your JavaScript development to the next level? Meet npm Enterprise - the ultimate in enterprise JavaScript. Learn more »

strincrement

1.0.2 • Public • Published

Strincrement

String incrementing id generator. Given an alphabet, generates unique sequential ids.

Use cases:

  • Non-numeric auto-incrementing ids
  • Spreadsheet column naming
  • CSS classname minification

Usage

import Strincrement from 'strincrement'
 
const generateId = Strincrement()
console.log(generateId()) // 'a'
console.log(generateId()) // 'b'
console.log(generateId()) // 'c'
// ...
console.log(generateId()) // 'aa'
console.log(generateId()) // 'ab'

Supply your own alphabet

const generateId = Strincrement('XYZ')
console.log(generateId()) // 'X'
console.log(generateId()) // 'Y'
console.log(generateId()) // 'Z'
console.log(generateId()) // 'XX'
console.log(generateId()) // 'XY'

install

npm i strincrement

Downloadsweekly downloads

317

version

1.0.2

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability