hemangsk / ngx-morse

A simple morse code encoder and decoder for Angular.

Home Page:https://monkeyscript.github.io/ngx-morse/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Ngx-Morse

npm

A simple morse code encoder and decoder for Angular.

Demo : https://monkeyscript.github.io/ngx-morse/

Installation

Using npm :

$ npm i ngx-morse

Usage

Import and use NgxMorseService in your component. It's that simple :)

import { NgxMorseService } from 'ngx-morse';
 
@Component({...})

export class YourComponent {
  
  constructor(private morse: NgxMorseService) {}
 
  encode() {
    let encoded = this.morse.encode('hello world!');
    // .... . .-.. .-.. --- / .-- --- .-. .-.. -.. -.-.--
  }

  decode() {
    let decoded = this.morse.decode('.... . .-.. .-.. --- / .-- --- .-. .-.. -.. -.-.--');
    // hello world!
  }

}

Methods

  • encode() : Takes a text as input and returns its morse code.

  • decode() : Takes a morse code as input and returns its text value.

Issues & Contributions

For a new feature, create an issue here. Open to all contributions :)

License

Apache-2.0. Please see the license file for more information.

About

A simple morse code encoder and decoder for Angular.

https://monkeyscript.github.io/ngx-morse/

License:Apache License 2.0


Languages

Language:TypeScript 68.3%Language:JavaScript 14.7%Language:HTML 12.3%Language:CSS 4.6%