excel-column-id
v1.0.8
Published
Generate IDs similar to Excel column ID.
Downloads
202
Maintainers
Readme
Excel Column ID
Generate IDs similar to Excel column ID.
Usage
npm i excel-column-id
import generateId from 'excel-column-id';
const A = generateId(0); // 'A'
const B = generateId(1); // 'B'
const AA = generateId(26); // 'AA'
APIs
generateId
▸ generateId(index
): string
Generate IDs similar to Microsoft Excel column IDs:
A, B, C, ...,
AA, AB, AC, ...,
BA, BB, BC, ...,
...
Parameters
| Name | Type | Description |
| :------ | :------- | :-------------------------------- |
| index
| number
| Index of the ID, starting from 0. |
Returns
string
ID string
License
MIT © Zhao DAI [email protected]