@ozdemirburak/morse-code-translator
Advanced tools
Comparing version 5.0.1 to 5.0.2
{ | ||
"name": "@ozdemirburak/morse-code-translator", | ||
"version": "5.0.1", | ||
"version": "5.0.2", | ||
"description": "Morse code translator helps you convert text to Morse code and vice versa, with the option to play Morse code audio.", | ||
@@ -5,0 +5,0 @@ "keywords": [ |
@@ -18,8 +18,9 @@ # [Morse Code Translator](https://morsecodetranslator.com) | ||
### Common JS | ||
```js | ||
const morse = require('morse-code-translator'); | ||
import morse from '@ozdemirburak/morse-code-translator'; | ||
const encoded = morse.encode('SOS'); // ... --- ... | ||
const decoded = morse.decode('... --- ...'); // SOS | ||
const characters = morse.characters(); // {'1': {'A': '.-', ...}, ..., '11': {'ㄱ': '.-..', ...}} | ||
const audio = morse.audio('SOS'); | ||
@@ -32,15 +33,3 @@ audio.play(); // play audio | ||
``` | ||
### Browser | ||
Morse decoder exports a global object named 'morse-code-translator'; | ||
```js | ||
const morse = window['morse-code-translator'] | ||
const audioElement = document.querySelector('audio'); | ||
const helloAudio = morse.audio('Hello world'); | ||
helloAudio.getWaveUrl().then((url) => { | ||
document.querySelector('#morse') | ||
.setAttribute('src', url); | ||
}); | ||
``` | ||
### Options and localization | ||
@@ -98,2 +87,3 @@ | ||
with extensive feedback and contributions from [numerous developers](https://github.com/ozdemirburak/morse-code-translator/graphs/contributors). | ||
Special thanks to [Chris Jones](https://github.com/chris--jones), who added many great features. | ||
@@ -116,13 +106,1 @@ | ||
[npm]: https://www.npmjs.com/package/@ozdemirburak/morse-code-translator | ||
## Generating Minified Files | ||
Install node and npm and run the commands below. | ||
``` bash | ||
$ npm install | ||
# generate `index.js` inside `src` | ||
$ npm run build | ||
# generate `morse-code-translator.min.js` (minified) inside `dist` | ||
$ npm run build-rel | ||
``` |
47754
103