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.
71c63c9fc0
Bumps [jest](https://github.com/facebook/jest) from 27.2.0 to 27.2.1. - [Release notes](https://github.com/facebook/jest/releases) - [Changelog](https://github.com/facebook/jest/blob/main/CHANGELOG.md) - [Commits](https://github.com/facebook/jest/compare/v27.2.0...v27.2.1) --- updated-dependencies: - dependency-name: jest dependency-type: direct:development update-type: version-update:semver-patch ... Signed-off-by: dependabot[bot] <support@github.com> |
||
---|---|---|
.github | ||
docs | ||
src | ||
.gitignore | ||
.npmignore | ||
CODE_OF_CONDUCT.md | ||
LICENSE.md | ||
package-lock.json | ||
package.json | ||
README.md | ||
rollup.config.js |
Alphabets
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 |