{"id":16972076,"url":"https://github.com/ozdemirburak/morse-code-translator","last_synced_at":"2025-04-07T21:12:11.261Z","repository":{"id":45919434,"uuid":"94221341","full_name":"ozdemirburak/morse-code-translator","owner":"ozdemirburak","description":"Translate text to Morse code and vice versa, with the option to play Morse code audio.","archived":false,"fork":false,"pushed_at":"2024-10-03T14:15:05.000Z","size":100,"stargazers_count":249,"open_issues_count":1,"forks_count":67,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-31T20:06:35.091Z","etag":null,"topics":["javascript","morse","morse-code","morse-code-converter","morse-code-translator","morse-decoder","morse-learning"],"latest_commit_sha":null,"homepage":"https://morsecodetranslator.com","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/ozdemirburak.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-06-13T14:22:36.000Z","updated_at":"2025-03-30T14:37:48.000Z","dependencies_parsed_at":"2024-09-29T13:19:16.404Z","dependency_job_id":"af363504-6a1c-41de-9560-37ea14a3ac1d","html_url":"https://github.com/ozdemirburak/morse-code-translator","commit_stats":{"total_commits":43,"total_committers":8,"mean_commits":5.375,"dds":"0.18604651162790697","last_synced_commit":"a2374dee3eaa8a8da9431c2ba1811e839223f9a0"},"previous_names":["ozdemirburak/morsify","ozdemirburak/morse-code-translator","ozdemirburak/morse-decoder"],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozdemirburak%2Fmorse-code-translator","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozdemirburak%2Fmorse-code-translator/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozdemirburak%2Fmorse-code-translator/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ozdemirburak%2Fmorse-code-translator/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ozdemirburak","download_url":"https://codeload.github.com/ozdemirburak/morse-code-translator/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247730068,"owners_count":20986404,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["javascript","morse","morse-code","morse-code-converter","morse-code-translator","morse-decoder","morse-learning"],"created_at":"2024-10-14T00:57:03.503Z","updated_at":"2025-04-07T21:12:11.242Z","avatar_url":"https://github.com/ozdemirburak.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# [Morse Code Translator](https://morsecodetranslator.com)\n\n[![npm-version]][npm] [![npm-downloads]][npm]\n\nMorse code encoder and Morse decoder with no dependencies. It supports Latin, Cyrillic, Greek, Hebrew, Arabic,\nPersian, Japanese, Korean, and Thai, with audio-generation functionality using the [Web Audio API](https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API).\n\n## Installation\n\n### npm\n\n```bash\n$ npm install @ozdemirburak/morse-code-translator --save\n```\n\n## Usage\n\n```js\nimport morse from '@ozdemirburak/morse-code-translator';\n\nconst encoded = morse.encode('SOS'); // ... --- ...\nconst decoded = morse.decode('... --- ...'); // SOS\nconst characters = morse.characters(); // {'1': {'A': '.-', ...}, ..., '11': {'ㄱ': '.-..', ...}}\n\nconst audio = morse.audio('SOS');\naudio.play(); // play audio\naudio.stop(); // stop audio (cannot resume)\naudio.exportWave(); // download audio wave file (promise)\nconst url = await audio.getWaveUrl(); // get audio wave url (promise)\nconst blob = await audio.getWaveBlob(); // get audio wave blob (promise)\n```\n\n### Options and localization\n\nYou can customize the dash, dot, or space characters and specify the alphabet with the priority option for\nan accurate encoding and decoding.\n\nThe priority option gives direction to the plugin to start searching for the given character set first.\n\nSet the priority option according to the list below.\n\n- 1 =\u003e ASCII (Default)\n- 2 =\u003e Numbers\n- 3 =\u003e Punctuation\n- 4 =\u003e Latin Extended (Turkish, Polish etc.)\n- 5 =\u003e Cyrillic\n- 6 =\u003e Greek\n- 7 =\u003e Hebrew\n- 8 =\u003e Arabic\n- 9 =\u003e Persian\n- 10 =\u003e Japanese\n- 11 =\u003e Korean\n- 12 =\u003e Thai\n\n```js\nconst cyrillic = morse.encode('Ленинград', { priority: 5 }); // .-.. . -. .. -. --. .-. .- -..\nconst greek = morse.decode('... .- --. .- .--. .--', { priority: 6 }); // ΣΑΓΑΠΩ\nconst hebrew = morse.decode('.. ––– . –––', { dash: '–', dot: '.', priority: 7 }); // יהוה\nconst japanese = morse.encode('NEWS', { priority: 10, dash: '－', dot: '・', separator: '　' }); // －・　・　・－－　・・・\nconst characters = morse.characters({ dash: '–', dot: '•' }); // {'1': {'A': '•–', ...}, ..., '11': {'ㄱ': '•–••', ...}}\nconst arabicAudio = morse.audio('البراق', { // generates the Morse .- .-.. -... .-. .- --.- then generates the audio from it\n  wpm: 18, // sets the wpm based on the Paris method, note that setting this will override and set the unit and fwUnits accordingly\n  unit: 0.1, // period of one unit, in seconds, 1.2 / c where c is speed of transmission, in words per minute\n  fwUnit: 0.1, // period of one Farnsworth unit to control intercharacter and interword gaps\n  volume: 100, // the volume in percent (0-100)\n  oscillator: {\n    type: 'sine', // sine, square, sawtooth, triangle\n    frequency: 500,  // value in hertz\n    onended: function () { // event that fires when the tone stops playing\n      console.log('ended');\n    }\n  }\n});\nconst oscillator = arabicAudio.oscillator; // OscillatorNode\nconst context = arabicAudio.context; // AudioContext;\nconst gainNode = arabicAudio.gainNode; // GainNode\narabicAudio.play(); // will start playing Morse audio\narabicAudio.stop(); // will stop playing Morse audio\n```\n\n## Contributions\n\n[morse-code-translator](https://github.com/ozdemirburak/morse-code-translator) has been developed \nwith extensive feedback and contributions from [numerous developers](https://github.com/ozdemirburak/morse-code-translator/graphs/contributors).\n\nSpecial thanks to [Chris Jones](https://github.com/chris--jones), who added many great features.\n\n## References\n\nPlease consider referencing the website of this project, if you find this package useful for your work.\n\n```html\n\u003ca href=\"https://morsecodetranslator.com\"\u003eMorse Code Translator\u003c/a\u003e\n```\n\n## License\n\nThe MIT License (MIT). Please see [License File](LICENSE) for more information.\n\n  [npm-version]: https://img.shields.io/npm/v/@ozdemirburak/morse-code-translator.svg?style=flat-square\n  [npm-downloads]: https://img.shields.io/npm/dm/@ozdemirburak/morse-code-translator.svg?style=flat-square\n  [npm]: https://www.npmjs.com/package/@ozdemirburak/morse-code-translator\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozdemirburak%2Fmorse-code-translator","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fozdemirburak%2Fmorse-code-translator","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fozdemirburak%2Fmorse-code-translator/lists"}