0.0.1 • Published 9 years ago

morse-jp v0.0.1

Weekly downloads
1
License
MIT
Repository
github
Last release
9 years ago

morse-jp

This is a tool that converts 'Text' and 'Morse cord' to each other.

テキストとモールス信号のコードを相互に変換するツール.

Installation

npm install morse-jp

Example

var MorseJp = require('../lib/morse-jp');
var morse = new MorseJp();

console.log(morse.word2morse('こんにちわ'));
// ---- .-.-. -.-. ..-. -.-

console.log(morse.morse2word('.-- --.--'));
// やあ

console.log(morse.morse2word('ああああ〜♥あ♥あ♥〜あ♥あ♥〜♥♥あ♥〜あ♥あ', {dash: 'あ', dot: '♥', separate: '〜'}));
// こんにちわ

console.log(morse.word2morse('おれがいる', {dash: 'それ', dot: 'ある', separate: '〜'}));
// あるそれあるあるある〜それそれそれ〜あるそれあるある〜あるある〜あるそれ〜それあるそれそれある

Development

# watch
npm run watch
# build
npm run build
# test
npm test

Contributing

  1. Fork it!
  2. Create your feature branch: git checkout -b my-new-feature
  3. Commit your changes: git commit -am 'Add some feature'
  4. Push to the branch: git push origin my-new-feature
  5. Submit a pull request :D

License

MIT