Socket
Socket
Sign inDemoInstall

alphabets

Package Overview
Dependencies
0
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    alphabets

A collection of many different alphabets for many different use cases.


Version published
Weekly downloads
3
decreased by-25%
Maintainers
1
Install size
7.01 kB
Created
Weekly downloads
 

Changelog

Source

[v2.0.4]

Fixed the X-ray entry in the NATO alphabet.

Readme

Source

Alphabets

A tiny JS package that exports many different alphabets for many different use cases.

npm Stand With Ukraine

Why

I have seen code like 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, and it pollutes your code. Instead, why not do it like this:

import { latin } from 'alphabets';

doSomethingWithTheAlphabet(latin);

Much cleaner, right?

Installation

Install the alphabets npm module using your preferred package manager:

  • npm: npm install alphabets
  • Yarn: yarn add alphabets
  • pnpm: pnpm add alphabets

Supported alphabets

See below for usage instructions.

AlphabetExport name
Danishdanish
Faroesefaroese
Greek (modern)greek
Greek (ancient/polytonic)greekPolytonic
Icelandicicelandic
Latin (abcdefg etc.)latin
NATO phonetic alphabetnato
Norwegiannorwegian
Russianrussian
Swedishswedish
Ukrainianukrainian

How to use

Replace <alphabetYouWantToUse> with an alphabet identifier this package supports:

import { <alphabetYouWantToUse> } from 'alphabets';

or:

const alphabets = require('alphabets');
console.log(alphabets.<alphabetYouWantToUse>);

(c) 2021-2023 Romein van Buren. Licensed under the MIT license.

For the full copyright and license information, please view the LICENSE.md file that was distributed with this source code.

Keywords

FAQs

Last updated on 07 Aug 2023

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc