npm

npm’s 2019 JavaScript ecosystem survey analysis is now available!Get your copy here »

strincrement

1.0.3 • 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

449

version

1.0.3

license

MIT

homepage

github.com

repository

Gitgithub

last publish

collaborators

  • avatar
Report a vulnerability