1
0
mirror of https://github.com/garraflavatra/alphabets.git synced 2025-04-10 23:51:03 +00:00

Compare commits

...

4 Commits
v2.0.5 ... main

Author SHA1 Message Date
03880f2bbe
It is 2024 2024-08-06 14:39:41 +02:00
3da31450c0
Update readme 2024-08-06 14:37:07 +02:00
d070b6c2f1
Add logo 2024-08-06 14:26:49 +02:00
c917b46c48
Added v2.0.5 in changelog 2023-08-08 21:54:44 +02:00
3 changed files with 27 additions and 10 deletions

View File

@ -1,4 +1,4 @@
## [Unreleased]
## [v2.0.5]
Added Polish alphabet, plus support for Deno!
@ -54,3 +54,4 @@ Initial release.
[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.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-2023 Romein van Buren <<romein@vburen.nl>>
Copyright (c) 2021-2024 Romein van Buren <<romein@vburen.nl>>
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal

View File

@ -1,9 +1,16 @@
# Alphabets
A tiny JS package that exports many different alphabets for many different use cases.
Alphabets contains many different alphabets for many different use cases.
[![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
@ -23,7 +30,9 @@ See below for [usage instructions](#how-to-use).
| `swedish` | [Swedish](https://en.wikipedia.org/wiki/Swedish_alphabet) |
| `ukrainian` | [Ukrainian](https://en.wikipedia.org/wiki/Ukrainian_alphabet) |
## Installation
## How to use
### JS module
Install the [alphabets npm module](https://www.npmjs.com/package/alphabets) using your preferred package manager:
@ -33,8 +42,6 @@ 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`.
## How to use
Replace `<alphabetYouWantToUse>` with an [alphabet identifier](#included-alphabets) this package exports:
```js
@ -54,7 +61,14 @@ const alphabets = require('alphabets');
console.log(alphabets.<alphabetYouWantToUse>);
```
## Why
### JSON file
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):
@ -68,7 +82,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"];
```
My opinion about this: it's ugly, and it pollutes your code. Instead, why not [do it like this](#how-to-use):
My opinion about this: it's verbose, ugly, and it pollutes your code. Instead, why not [do it like this](#how-to-use):
```js
import { latin } from 'alphabets';
@ -86,6 +100,8 @@ You may use the same issue form for questions, too.
## Copyright
(c) 2021-2023 [Romein van Buren](mailto:romein@vburen.nl). Licensed under the MIT license.
(c) 2021-2024 [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.
[![Smart Yellow](https://code.smartyellow.net/smartyellow/meta/raw/branch/main/logo.png)](https://www.smartyellow.nl)