New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

morsey

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

morsey

Encode and decode Morse code

latest
Source
npmnpm
Version
0.1.0
Version published
Weekly downloads
0
-100%
Maintainers
1
Weekly downloads
 
Created
Source

Morsey (Morse Encoder/Decoder) Build Status

Morsey is JavaScript library to convert text to Morse code and vice versa.

Install

npm install morsey

Import

CommonJS

const Morsey = require('morsey');

ES6 import

import Morsey from 'morsey';

CDN

You can use it directly in your browser using unpkg.com:

<script src="https://unpkg.com/morsey"></script>

Usage

import Morsey from 'morsey';

// with optional 'options'
const morse = new Morsey({ wordspace: '|' });

morse.encode('sample text');
// => ··· ·- -- ·--· ·-·· · | - · -··- -

morse.decode('··· ·- -- ·--· ·-·· · | - · -··- -');
// => SAMPLE TEXT

API

morse.encode(text)

text

Type: string

Text to encode.

morse.decode(code)

code

Type: string

Morse code to decode.

options

Type: object

Default:

{
  long: '-',
  short: '·',
  space: ' ',
  wordspace: '/',
}

Test

npm install
npm test

License

MIT © Zsolt Meszaros

Keywords

morse

FAQs

Package last updated on 07 Apr 2018

Did you know?

Socket

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