1
0
mirror of https://github.com/garraflavatra/alphabets.git synced 2025-04-20 03:01:02 +00:00

Compare commits

..

No commits in common. "main" and "v2.0.5" have entirely different histories.
main ... v2.0.5

3 changed files with 10 additions and 27 deletions

View File

@ -1,4 +1,4 @@
## [v2.0.5] ## [Unreleased]
Added Polish alphabet, plus support for Deno! Added Polish alphabet, plus support for Deno!
@ -54,4 +54,3 @@ Initial release.
[v2.0.2]: https://github.com/garraflavatra/alphabets/releases/tag/v2.0.2 [v2.0.2]: https://github.com/garraflavatra/alphabets/releases/tag/v2.0.2
[v2.0.3]: https://github.com/garraflavatra/alphabets/releases/tag/v2.0.3 [v2.0.3]: https://github.com/garraflavatra/alphabets/releases/tag/v2.0.3
[v2.0.4]: https://github.com/garraflavatra/alphabets/releases/tag/v2.0.4 [v2.0.4]: https://github.com/garraflavatra/alphabets/releases/tag/v2.0.4
[v2.0.5]: https://github.com/garraflavatra/alphabets/releases/tag/v2.0.5

View File

@ -1,4 +1,4 @@
Copyright (c) 2021-2024 Romein van Buren <<romein@vburen.nl>> Copyright (c) 2021-2023 Romein van Buren <<romein@vburen.nl>>
Permission is hereby granted, free of charge, to any person obtaining a copy Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal of this software and associated documentation files (the "Software"), to deal

View File

@ -1,16 +1,9 @@
# Alphabets # Alphabets
Alphabets contains many different alphabets for many different use cases. A tiny JS package that exports many different alphabets for many different use cases.
[![npm](https://img.shields.io/npm/v/alphabets)](https://www.npmjs.com/package/alphabets) [![npm](https://img.shields.io/npm/v/alphabets)](https://www.npmjs.com/package/alphabets)
[![Stand With Ukraine](https://raw.githubusercontent.com/vshymanskyy/StandWithUkraine/main/badges/StandWithUkraine.svg)](https://stand-with-ukraine.pp.ua)
- [Included alphabets](#included-alphabets)
- [How to use](#how-to-use)
- [JS module](#js-module)
- [JSON file](#json-file)
- [Motivation](#motivation)
- [Questions and bugs](#questions-and-bugs)
- [Copyright](#copyright)
## Included alphabets ## Included alphabets
@ -30,9 +23,7 @@ See below for [usage instructions](#how-to-use).
| `swedish` | [Swedish](https://en.wikipedia.org/wiki/Swedish_alphabet) | | `swedish` | [Swedish](https://en.wikipedia.org/wiki/Swedish_alphabet) |
| `ukrainian` | [Ukrainian](https://en.wikipedia.org/wiki/Ukrainian_alphabet) | | `ukrainian` | [Ukrainian](https://en.wikipedia.org/wiki/Ukrainian_alphabet) |
## How to use ## Installation
### JS module
Install the [alphabets npm module](https://www.npmjs.com/package/alphabets) using your preferred package manager: Install the [alphabets npm module](https://www.npmjs.com/package/alphabets) using your preferred package manager:
@ -42,6 +33,8 @@ Install the [alphabets npm module](https://www.npmjs.com/package/alphabets) usin
You can also use it with [Deno](https://deno.land/) by importing `https://deno.land/x/alphabets/alphabets.mjs`. You can also use it with [Deno](https://deno.land/) by importing `https://deno.land/x/alphabets/alphabets.mjs`.
## How to use
Replace `<alphabetYouWantToUse>` with an [alphabet identifier](#included-alphabets) this package exports: Replace `<alphabetYouWantToUse>` with an [alphabet identifier](#included-alphabets) this package exports:
```js ```js
@ -61,14 +54,7 @@ const alphabets = require('alphabets');
console.log(alphabets.<alphabetYouWantToUse>); console.log(alphabets.<alphabetYouWantToUse>);
``` ```
### JSON file ## Why
Or load the JSON file with alphabets directly from a CDN:
* https://cdn.jsdelivr.net/npm/alphabets@2/alphabets.json
* https://unpkg.com/alphabets@2/alphabets.json
## Motivation
I have seen [code like this](https://github.com/search?q=%27abcdefghijklmnopqrstuvwxyz%27.split%28%27%27%29+language%3AJavaScript&type=code&l=JavaScript): I have seen [code like this](https://github.com/search?q=%27abcdefghijklmnopqrstuvwxyz%27.split%28%27%27%29+language%3AJavaScript&type=code&l=JavaScript):
@ -82,7 +68,7 @@ Or [even worse](https://github.com/search?q=%5B%22a%22%2C+%22b%22%2C+%22c%22%2C+
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"]; 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 verbose, ugly, and it pollutes your code. Instead, why not [do it like this](#how-to-use): My opinion about this: it's ugly, and it pollutes your code. Instead, why not [do it like this](#how-to-use):
```js ```js
import { latin } from 'alphabets'; import { latin } from 'alphabets';
@ -100,8 +86,6 @@ You may use the same issue form for questions, too.
## Copyright ## Copyright
(c) 2021-2024 [Romein van Buren](mailto:romein@vburen.nl). Licensed under the MIT license. (c) 2021-2023 [Romein van Buren](mailto:romein@vburen.nl). Licensed under the MIT license.
For the full copyright and license information, please see the [`LICENSE.md`](./LICENSE.md) file that was distributed with this source code. For the full copyright and license information, please see the [`LICENSE.md`](./LICENSE.md) file that was distributed with this source code.
[![Smart Yellow](https://code.smartyellow.net/smartyellow/meta/raw/branch/main/logo.png)](https://www.smartyellow.nl)