+2
-2
@@ -11,4 +11,2 @@ { | ||
| "greekPolytonic": ["α", "β", "γ", "δ", "ε", "ζ", "η", "θ", "ι", "κ", "λ", "μ", "ν", "ξ", "ο", "π", "ρ", "σ", "τ", "υ", "φ", "χ", "ψ", "ω"], | ||
| "icelandic": ["a", "á", "b", "d", "ð", "e", "é", "f", "g", "h", "i", "í", "j", "k", "l", "m", "n", "o", "ó", "p", "r", "s", "t", "u", "ú", "v", "x", "y", "ý", "þ", "æ", "ö"], | ||
@@ -22,2 +20,4 @@ | ||
| "polish": ["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", "ź", "ż"], | ||
| "russian": ["а", "б", "в", "г", "д", "е", "ё", "ж", "з", "и", "й", "к", "л", "м", "н", "о", "п", "р", "с", "т", "у", "ф", "х", "ц", "ч", "ш", "щ", "ъ", "ы", "ь", "э", "ю", "я"], | ||
@@ -24,0 +24,0 @@ |
+1
-1
@@ -5,3 +5,3 @@ { | ||
| "author": "Romein van Buren <romein@vburen.nl>", | ||
| "version": "2.0.4", | ||
| "version": "2.0.5", | ||
| "homepage": "https://github.com/garraflavatra/alphabets#readme", | ||
@@ -8,0 +8,0 @@ "license": "MIT", |
+54
-45
@@ -8,26 +8,20 @@ # Alphabets | ||
| ## Why | ||
| ## Included alphabets | ||
| I have seen [code like this]: | ||
| See below for [usage instructions](#how-to-use). | ||
| ```js | ||
| const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''); | ||
| ``` | ||
| | Export name | Alphabet | | ||
| |------------------|------------------| | ||
| | `danish` | [Danish](https://en.wikipedia.org/wiki/Danish_orthography), same as Norwegian | | ||
| | `faroese` | [Faroese](https://en.wikipedia.org/wiki/Faroese_orthography) | | ||
| | `greek` | [Greek](https://en.wikipedia.org/wiki/Greek_alphabet) | | ||
| | `icelandic` | [Icelandic](https://en.wikipedia.org/wiki/Icelandic_orthography) | | ||
| | `latin` | [Latin](https://en.wikipedia.org/wiki/Latin_alphabet) (abcdefg etc.) | | ||
| | `nato` | [NATO phonetic alphabet](https://en.wikipedia.org/wiki/NATO_phonetic_alphabet) | | ||
| | `norwegian` | [Norwegian](https://en.wikipedia.org/wiki/Danish_and_Norwegian_alphabet), same as Danish | | ||
| | `polish` | [Polish](https://en.wikipedia.org/wiki/Polish_alphabet) | | ||
| | `russian` | [Russian](https://en.wikipedia.org/wiki/Russian_alphabet) | | ||
| | `swedish` | [Swedish](https://en.wikipedia.org/wiki/Swedish_alphabet) | | ||
| | `ukrainian` | [Ukrainian](https://en.wikipedia.org/wiki/Ukrainian_alphabet) | | ||
| Or [worse]: | ||
| ```js | ||
| 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): | ||
| ```js | ||
| import { latin } from 'alphabets'; | ||
| doSomethingWithTheAlphabet(latin); | ||
| ``` | ||
| Much cleaner, right? | ||
| ## Installation | ||
@@ -41,23 +35,7 @@ | ||
| ## Supported alphabets | ||
| You can also use it with [Deno](https://deno.land/) by importing `https://deno.land/x/alphabets/alphabets.mjs`. | ||
| See below for [usage instructions](#how-to-use). | ||
| | Alphabet | Export name | | ||
| |---------------------------|------------------| | ||
| | Danish | `danish` | | ||
| | Faroese | `faroese` | | ||
| | Greek (modern) | `greek` | | ||
| | Greek (ancient/polytonic) | `greekPolytonic` | | ||
| | Icelandic | `icelandic` | | ||
| | Latin (abcdefg etc.) | `latin` | | ||
| | [NATO phonetic alphabet] | `nato` | | ||
| | Norwegian | `norwegian` | | ||
| | Russian | `russian` | | ||
| | Swedish | `swedish` | | ||
| | Ukrainian | `ukrainian` | | ||
| ## How to use | ||
| Replace `<alphabetYouWantToUse>` with an alphabet identifier this package supports: | ||
| Replace `<alphabetYouWantToUse>` with an [alphabet identifier](#included-alphabets) this package exports: | ||
@@ -68,2 +46,8 @@ ```js | ||
| Deno: | ||
| ```js | ||
| import { <alphabetYouWantToUse> } from 'https://deno.land/x/alphabets/alphabets.mjs'; | ||
| ``` | ||
| or: | ||
@@ -76,11 +60,36 @@ | ||
| ## Copyright | ||
| ## Why | ||
| (c) 2021-2023 Romein van Buren. Licensed under the MIT license. | ||
| I have seen [code like this](https://github.com/search?q=%27abcdefghijklmnopqrstuvwxyz%27.split%28%27%27%29+language%3AJavaScript&type=code&l=JavaScript): | ||
| For the full copyright and license information, please view the [`LICENSE.md`](./LICENSE.md) file that was distributed with this source code. | ||
| ```js | ||
| const alphabet = 'abcdefghijklmnopqrstuvwxyz'.split(''); | ||
| ``` | ||
| Or [even worse](https://github.com/search?q=%5B%22a%22%2C+%22b%22%2C+%22c%22%2C+%22d%22%2C+%22e%22%2C+%22f%22%2C+%22g%22%2C+%22h%22%2C+%22i%22%2C+%22j%22%2C+%22k%22%2C+%22l%22%2C+%22m%22%2C+%22n%22%2C+%22o%22%2C+%22p%22%2C+%22q%22%2C+%22r%22%2C+%22s%22%2C+%22t%22%2C+%22u%22%2C+%22v%22%2C+%22w%22%2C+%22x%22%2C+%22y%22%2C+%22z%22%5D+language%3AJavaScript&type=code&l=JavaScript): | ||
| [code like this]: https://github.com/search?q=%27abcdefghijklmnopqrstuvwxyz%27.split%28%27%27%29+language%3AJavaScript&type=code&l=JavaScript | ||
| [worse]: https://github.com/search?q=%5B%22a%22%2C+%22b%22%2C+%22c%22%2C+%22d%22%2C+%22e%22%2C+%22f%22%2C+%22g%22%2C+%22h%22%2C+%22i%22%2C+%22j%22%2C+%22k%22%2C+%22l%22%2C+%22m%22%2C+%22n%22%2C+%22o%22%2C+%22p%22%2C+%22q%22%2C+%22r%22%2C+%22s%22%2C+%22t%22%2C+%22u%22%2C+%22v%22%2C+%22w%22%2C+%22x%22%2C+%22y%22%2C+%22z%22%5D+language%3AJavaScript&type=code&l=JavaScript | ||
| [NATO phonetic alphabet]: https://en.wikipedia.org/wiki/NATO_phonetic_alphabet | ||
| ```js | ||
| 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): | ||
| ```js | ||
| import { latin } from 'alphabets'; | ||
| for (const glyph of latin) {/* ... */} | ||
| ``` | ||
| This is much cleaner and more idiomatic. | ||
| ## Questions and bugs | ||
| Did you find a mistake in an alphabet, or another bug? Please [report it](https://github.com/garraflavatra/alphabets/issues/new) — thank you! I'll try to fix it as soon as possible. | ||
| 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. | ||
| For the full copyright and license information, please see the [`LICENSE.md`](./LICENSE.md) file that was distributed with this source code. |
8088
12.6%92
10.84%