sequence-string
v1.0.0
Published
A JavaScript package that generates the next sequence string based on a given word.
Downloads
5
Maintainers
Readme
sequence-string
A JavaScript package that generates the next sequence string based on a given word.
generateNextWord increments a given string following a sequence: 0-9, a-z, A-Z. It transforms characters sequentially; if 'Z' is encountered, it resets to '0' and increments the preceding character. The function is designed for easy creation of incremented sequences across numbers, lowercase, and uppercase letters.
📦 Installation
npm i sequence-string
Author
Rahul Singh Kushwah
Declaration
Require sequence-string in the top of your file
import generateNextWord from 'sequence-string';
API
generateNextWord(word: string): string Generates the next sequence string based on the given word.
word: The input sequence string.
Usage
const { generateNextWord } = require('sequence-string');
// Example usage:
const originalWord = 'abc';
console.log(generateNextWord(originalWord)); // Output: 'abd'
const originalWord = '2729';
console.log(generateNextWord(originalWord)); // Output: '272a'
const originalWord = '00aaAz';
console.log(generateNextWord(originalWord)); // Output: '00aaAA'
const originalWord = 'qs72Z';
console.log(generateNextWord(originalWord)); // Output: 'qs730'
License
This project is licensed under the MIT License - see the LICENSE file for details.