1
0
mirror of https://github.com/garraflavatra/alphabets.git synced 2024-11-24 18:36:56 +01:00
A collection of many different alphabets for many different use cases.
Go to file
2023-05-04 19:45:44 +02:00
.gitignore
alphabets.cjs Alphabets 2.0.0 2023-05-04 19:25:45 +02:00
alphabets.json Added Ukrainian alphabet, bump to 2.0.1 2023-05-04 19:44:05 +02:00
alphabets.mjs Alphabets 2.0.0 2023-05-04 19:25:45 +02:00
LICENSE.md Alphabets 2.0.0 2023-05-04 19:25:45 +02:00
package-lock.json Fixed double typo in filename, bump version to 2.0.2 2023-05-04 19:45:44 +02:00
package.json Fixed double typo in filename, bump version to 2.0.2 2023-05-04 19:45:44 +02:00
README.md Added Ukrainian alphabet, bump to 2.0.1 2023-05-04 19:44:05 +02:00

Alphabets

A tiny JS dependency which exports many alphabets for many 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, you should do it like so:

import { latin } from 'alphabets';
// or
const alphabets = require('alphabets');

doSomethingWithTheAlphabet(latin);

Much cleaner, right?

Installation

Use npm: npm i alphabets. Or if you prefer Yarn: yarn 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
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.