1
0
mirror of https://github.com/garraflavatra/alphabets.git synced 2024-11-22 10:27:36 +01:00
A collection of many different alphabets for many different use cases.
Go to file
dependabot[bot] ffda23bd62 Bump addressable from 2.7.0 to 2.8.0 in /docs
Bumps [addressable](https://github.com/sporkmonger/addressable) from 2.7.0 to 2.8.0.
- [Release notes](https://github.com/sporkmonger/addressable/releases)
- [Changelog](https://github.com/sporkmonger/addressable/blob/main/CHANGELOG.md)
- [Commits](https://github.com/sporkmonger/addressable/compare/addressable-2.7.0...addressable-2.8.0)

---
updated-dependencies:
- dependency-name: addressable
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-07-12 22:36:10 +02:00
.github Create issue templates 2021-06-01 16:19:52 +02:00
.husky Add test Git hook 2021-05-24 13:40:57 +02:00
docs Bump addressable from 2.7.0 to 2.8.0 in /docs 2021-07-12 22:36:10 +02:00
src Add Scandinavian alphabets 2021-05-24 15:01:04 +02:00
.gitignore Initial commit 2021-05-24 12:32:23 +02:00
.npmignore Initial commit 2021-05-24 12:32:23 +02:00
CODE_OF_CONDUCT.md Add code of conduct 2021-05-24 13:47:23 +02:00
LICENSE.md Initial commit 2021-05-24 12:32:23 +02:00
package-lock.json Bump rollup from 2.53.0 to 2.53.1 2021-07-12 22:34:27 +02:00
package.json Bump husky from 6.0.0 to 7.0.1 2021-07-08 18:25:07 +02:00
README.md Upgrade documentation site 2021-05-24 18:05:14 +02:00
rollup.config.js Initial commit 2021-05-24 12:32:23 +02:00

Alphabets

CI npm npm bundle size GitHub last commit Forum

A tiny JS dependency (<2kb!) which exports many alphabets for many use cases.

More information is available in the documentation.

Why would I use this?

Why?

I have seen developers doing 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, it makes your code less readable (read: ugly) and it's simply not something you should want to have in your code! Instead, you should do it like so:

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

Much cleaner, right? That's why I made this package.

Installation

Use npm:

npm install alphabets --save

Or if you prefer Yarn:

yarn add alphabets

CDN, if that's more your style:

<script src="https://unpkg.com/alphabet@1/dist/bundle.js"></script>

Usage

import { <alphabetYouWantToUse> } from 'alphabets';

or:

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

where <alphabetYouWantToUse> is an alphabet this package supports. Here is a list from which you can choose.

Supported alphabets

Usage: see Usage.

Name Export name
Danish danish
Faroese faroese
Greek (modern) greek
Greek (ancient/polytonic) greekPolytonic
Icelandic icelandic
Latin latin
Norwegian norwegian
Swedish swedish