# morse-module

> [![npm](https://img.shields.io/npm/v/morse-module)](https://www.npmjs.com/package/morse-module) [![npm](https://img.shields.io/npm/dm/morse-module)](https://www.npmjs.com/package/morse-module)

Latest version **1.1.2** (published 2022-05-01) · ISC license · 0 weekly downloads

## Install

```sh
npm install morse-module
pnpm add morse-module
yarn add morse-module
bun add morse-module
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.1.2 |
| Published | 2022-05-01 |
| First published | 2022-04-30 |
| Weekly downloads | 0 |
| License | ISC |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 5.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Henry_emdth |
| Maintainers | henry_emdth |
| Keywords | morse, encoder, decoder, morse code encoder, morse code decoder |

## Links

- npm: https://www.npmjs.com/package/morse-module
- npm.io page: https://npm.io/package/morse-module

## Alternatives

- [flatbuffers](https://npm.io/package/flatbuffers.md) — 6.0M weekly downloads
- [@exodus/patch-broken-hermes-typed-arrays](https://npm.io/package/@exodus/patch-broken-hermes-typed-arrays.md) — 28.5K weekly downloads
- [@native-to-anchor/buffer-layout](https://npm.io/package/@native-to-anchor/buffer-layout.md) — 12.2K weekly downloads
- [binary-parser-encoder](https://npm.io/package/binary-parser-encoder.md) — 5.3K weekly downloads
- [datasets-fi-postalcodes](https://npm.io/package/datasets-fi-postalcodes.md) — 1.1K weekly downloads

## Recent versions

- 1.1.2 (latest) — 2022-05-01
- 1.0.0 — 2022-04-30

## README

# Morse Module
[![npm](https://img.shields.io/npm/v/morse-module)](https://www.npmjs.com/package/morse-module)
[![npm](https://img.shields.io/npm/dm/morse-module)](https://www.npmjs.com/package/morse-module)

This module will help you interpret Morse code into Latin text.

## Installation

### npm

    $ npm i morse-module
## Usage

```ts
const codeText = require('morse-module');
    
console.log(codeText.textToMorse('HELLO WORLD NODEJS'));
console.log(codeText.morseToText('-. --- -.. . .--- ...'));
```
### Console
     .... . .-.. .-.. --- / .-- --- .-. .-.. -.. / -. --- -.. . .--- ...
     NODEJS

## User guide

| **Method**        | **Description**                                                                                           | **Parameter** | **Return Value**     |
|---------------|-------------------------------------------------------------------------------------------------------|-----------|------------------|
| `textToMorse()` | convert morse code to latin text                                                                      | `String`    | `String`           |
| `morseToText()` | convert latin text code to morse code, if the format of the code is invalid it will return `Undefined`. | `String`    | `String` `undefined` |

## Morse code format
- Morse code to be interpreted into Latin must **have a space** ` ` between character, number or symbol.
- To represent a space it must be expressed as: **space bar space**` / `.
- Morse code must not contain a leading or trailing space.
- For Morse code, it is considered invalid if there are characters other than:`.` ` `(space) `/`.

## List code suport

### Latin

| **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** | --.. |       |      |       |      |       |      |       |      |

### Numbers

| **0** | ----- | **1** | .---- | **2** | ..--- | **3** | ...-- | **4** | ....- | **5** | ..... |
|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|-------|
| **6** | -.... | **7** | --... | **8** | ---.. | **9** | ----. |       |       |       |       |

### Puntuation

| **.** | .-.-.- | **,** | --..-- | **?** | ..--.. | **'** | .----. | **!** | -.-.--  | **/** | -..-.  |
|-------|--------|-------|--------|-------|--------|-------|--------|-------|---------|-------|--------|
| **(** | -.--.  | **)** | -.--.- | **&** | .-...  | **:** | ---... | **;** | -.-.-.  | **=** | -...-  |
| **+** | .-.-.  | **-** | -....- | **_** | ..--.- | **"** | .-..-. | **$** | ...-..- | **@** | .--.-. |
| **¿** | ..-.-  | **¡** | --...- |       |        |       |        |       |         |       |        |

---
_Source: https://npm.io/package/morse-module · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
