🚨 Shai-Hulud Strikes Again:834 Packages Compromised.Technical Analysis →
Socket
Book a DemoInstallSign in
Socket

number-to-alphabet

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

number-to-alphabet

Simple library to convert a number to sequence of letters and vice versa.

latest
Source
npmnpm
Version
1.0.0
Version published
Weekly downloads
1.2K
-30.31%
Maintainers
1
Weekly downloads
 
Created
Source

Number-To-Alphabet

Convert a number to a string and vice versa, using the provided alphabet (or default of a-z).

Installation

$ npm install number-to-alphabet

Examples

import { NumberToAlphabet } from 'number-to-alphabet';

const defaultAlphabet = new NumberToAlphabet();
defaultAlphabet.numberToString(1);    // 'a'
defaultAlphabet.numberToString(2);    // 'b'
defaultAlphabet.numberToString(27);   // 'aa'
defaultAlphabet.numberToString(28);   // 'ab'
defaultAlphabet.stringToNumber('ab'); // 28

const customAlphabet = new NumberToAlphabet(['A', 'B']);
customAlphabet.numberToString(1);    // 'A'
customAlphabet.numberToString(2);    // 'B'
customAlphabet.numberToString(3);    // 'AA'
customAlphabet.numberToString(4);    // 'AB'
customAlphabet.stringToNumber('AB'); // 4

Keywords

alphabet

FAQs

Package last updated on 26 Aug 2019

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts