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
dependabot[bot] f5a2d25b9f Bump rollup from 2.56.3 to 2.57.0
Bumps [rollup](https://github.com/rollup/rollup) from 2.56.3 to 2.57.0.
- [Release notes](https://github.com/rollup/rollup/releases)
- [Changelog](https://github.com/rollup/rollup/blob/master/CHANGELOG.md)
- [Commits](https://github.com/rollup/rollup/compare/v2.56.3...v2.57.0)

---
updated-dependencies:
- dependency-name: rollup
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
2021-09-23 16:00:16 +02:00
.github Setup CodeQL analysis 2021-08-23 14:41:35 +02:00
docs Fix another link 2021-09-11 11:48:14 +02:00
src Sort alphabets alphabetically 2021-07-15 10:59:54 +02:00
.gitignore
.npmignore
CODE_OF_CONDUCT.md Add code of conduct 2021-05-24 13:47:23 +02:00
LICENSE.md Update license year 2021-07-29 15:34:01 +02:00
package-lock.json Bump rollup from 2.56.3 to 2.57.0 2021-09-23 16:00:16 +02:00
package.json Remove Husky 2021-08-23 14:40:41 +02:00
README.md Fix typo in readme 2021-07-15 11:15:58 +02:00
rollup.config.js

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/alphabets@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
Russian russian
Swedish swedish