2.0.4 • Published 9 months ago

alphabets v2.0.4

Weekly downloads
-
License
MIT
Repository
github
Last release
9 months ago

Alphabets

A tiny JS package that exports many different alphabets for many different use cases.

npm Stand With Ukraine

Why

I have seen code like this:

const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split('');

Or worse:

const alphabet = ["a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "x", "y", "z"];

My opinion about this: it's ugly, and it pollutes your code. Instead, why not do it like this:

import { latin } from 'alphabets';

doSomethingWithTheAlphabet(latin);

Much cleaner, right?

Installation

Install the alphabets npm module using your preferred package manager:

  • npm: npm install alphabets
  • Yarn: yarn add alphabets
  • pnpm: pnpm add alphabets

Supported alphabets

See below for usage instructions.

AlphabetExport name
Danishdanish
Faroesefaroese
Greek (modern)greek
Greek (ancient/polytonic)greekPolytonic
Icelandicicelandic
Latin (abcdefg etc.)latin
NATO phonetic alphabetnato
Norwegiannorwegian
Russianrussian
Swedishswedish
Ukrainianukrainian

How to use

Replace <alphabetYouWantToUse> with an alphabet identifier this package supports:

import { <alphabetYouWantToUse> } from 'alphabets';

or:

const alphabets = require('alphabets');
console.log(alphabets.<alphabetYouWantToUse>);

Copyright

(c) 2021-2023 Romein van Buren. Licensed under the MIT license.

For the full copyright and license information, please view the LICENSE.md file that was distributed with this source code.

2.0.4

9 months ago

2.0.3

1 year ago

2.0.2

1 year ago

2.0.1

1 year ago

2.0.0

1 year ago

1.2.0

3 years ago

1.1.0

3 years ago

1.0.0

3 years ago