1
0
mirror of https://github.com/garraflavatra/alphabets.git synced 2024-11-21 22:59:03 +01:00
A collection of many different alphabets for many different use cases.
Go to file
2023-08-07 20:43:50 +02:00
.gitignore
alphabets.cjs
alphabets.json Added changelog file 2023-08-07 20:41:03 +02:00
alphabets.mjs
CHANGELOG.md v2.0.4 2023-08-07 20:43:50 +02:00
LICENSE.md Added e-mail address to license 2023-08-07 20:42:08 +02:00
package-lock.json v2.0.4 2023-08-07 20:43:50 +02:00
package.json v2.0.4 2023-08-07 20:43:50 +02:00
README.md Updated readme tagline 2023-08-07 20:43:05 +02:00

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.

Alphabet Export name
Danish danish
Faroese faroese
Greek (modern) greek
Greek (ancient/polytonic) greekPolytonic
Icelandic icelandic
Latin (abcdefg etc.) latin
NATO phonetic alphabet nato
Norwegian norwegian
Russian russian
Swedish swedish
Ukrainian ukrainian

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>);

(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.