{"id":15724983,"url":"https://github.com/ecto/morse","last_synced_at":"2025-04-16T04:44:22.116Z","repository":{"id":3652702,"uuid":"4720642","full_name":"ecto/morse","owner":"ecto","description":":heavy_minus_sign: simple Morse code library for node","archived":false,"fork":false,"pushed_at":"2016-02-22T19:20:11.000Z","size":195,"stargazers_count":62,"open_issues_count":2,"forks_count":12,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-03-29T05:01:44.076Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","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/ecto.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}},"created_at":"2012-06-20T00:05:59.000Z","updated_at":"2025-03-13T13:47:06.000Z","dependencies_parsed_at":"2022-08-19T02:40:35.486Z","dependency_job_id":null,"html_url":"https://github.com/ecto/morse","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fmorse","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fmorse/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fmorse/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ecto%2Fmorse/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ecto","download_url":"https://codeload.github.com/ecto/morse/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":249197455,"owners_count":21228570,"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":[],"created_at":"2024-10-03T22:18:41.390Z","updated_at":"2025-04-16T04:44:22.090Z","avatar_url":"https://github.com/ecto.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"#morse\n\nA simple Morse code library for node\n\n![Samuel F.B. Morse](http://i.imgur.com/HHHTQ.jpg)\n\n## install\n\nFor use as a CLI:\n\n    npm install -g morse\n\nFor use as a library:\n\n    npm install morse\n\n## example usage as a CLI\n\n````\n$ morse -h\nUsage: morse [options] string\n\nOptions:\n  -d, --decode  Decode a string of Morse code  [boolean]\n  -h, --help    Show this text  \n\n$ morse hello \u003e hello.txt\n$ morse -d \"`cat hello.txt`\"\nHELLO\n````\n\n## example usage as a library\n\n````javascript\nvar morse = require('morse');\n\nvar encoded = morse.encode('Hello, world.');\n// .... . .-.. .-.. --- --..-- ....... .-- --- .-. .-.. -.. .-.-.-\n\nmorse.decode(encoded);\n// HELLO, WORLD.\n````\n\n````javascript\nvar encoded = morse.encode([ 'hello', 'world' ]);\n// [ '.... . .-.. .-.. ---', '.-- --- .-. .-.. -..' ]\n\nmorse.decode(encoded);\n// [ 'HELLO', 'WORLD' ]\n````\n\n## methods\n\n### morse.encode(obj)\n\nEncodes and returns a given string or array\n\n### morse.decode(obj, dichotomic)\n\nDecodes and returns a string or array\n\n`dichotomic` defaults to false. If passed true, it will use a tree-based approach to decode the string or array. If false, a basic iteration of the map is used.\n\nThe dichotomic approach looks like this:\n\n![](http://i.imgur.com/Y1bnV.png)\n\nThe implementation does not include spaces right now, so it fails its test. However, it is otherwise accurate.\n\n````javascript\nmorse.decode(\n  morse.encode('Hello, world.'),\n  true\n);\n// HELLO,5WORLD.\n````\n\n## attributes\n\n### morse.map\n\nAn object containing `letter: morse` translations contained in `map.js`\n\n### morse.tree\n\nA tree-modeled object contained in `tree.js`\n\n## license\n\nMIT\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecto%2Fmorse","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fecto%2Fmorse","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fecto%2Fmorse/lists"}