{"id":20014778,"url":"https://github.com/pepebecker/mdbg","last_synced_at":"2025-05-04T22:31:22.174Z","repository":{"id":56104156,"uuid":"121830403","full_name":"pepebecker/mdbg","owner":"pepebecker","description":"Node wrapper for the MDBG database","archived":false,"fork":false,"pushed_at":"2020-11-25T10:44:15.000Z","size":4480,"stargazers_count":21,"open_issues_count":1,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-04-24T08:52:16.201Z","etag":null,"topics":["chinese","mandarin","mdbg","pinyin"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/mdbg","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"isc","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pepebecker.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":"2018-02-17T05:34:29.000Z","updated_at":"2024-11-28T04:45:45.000Z","dependencies_parsed_at":"2022-08-15T13:10:49.977Z","dependency_job_id":null,"html_url":"https://github.com/pepebecker/mdbg","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepebecker%2Fmdbg","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepebecker%2Fmdbg/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepebecker%2Fmdbg/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepebecker%2Fmdbg/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepebecker","download_url":"https://codeload.github.com/pepebecker/mdbg/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252408184,"owners_count":21743070,"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":["chinese","mandarin","mdbg","pinyin"],"created_at":"2024-11-13T07:43:53.868Z","updated_at":"2025-05-04T22:31:21.041Z","avatar_url":"https://github.com/pepebecker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# MDBG\n\n[![npm version](https://img.shields.io/npm/v/mdbg.svg)](https://www.npmjs.com/package/mdbg)\n[![Travis Build Status](https://travis-ci.org/pepebecker/mdbg.svg)](https://travis-ci.org/pepebecker/mdbg)\n[![dependency status](https://img.shields.io/david/pepebecker/mdbg.svg)](https://david-dm.org/pepebecker/mdbg)\n[![dev dependency status](https://img.shields.io/david/dev/pepebecker/mdbg.svg)](https://david-dm.org/pepebecker/mdbg#info=devDependencies)\n[![ISC-licensed](https://img.shields.io/github/license/pepebecker/mdbg.svg)](https://choosealicense.com/licenses/isc/)\n\n## Install\n\n```shell\nnpm install mdbg\n```\n\n## Usage\n\n```js\nconst mdbg = require('mdbg')\n\nmdbg.get('苹果') // mdbg.getByHanzi('苹果')\n.then(console.log)\n// {\n//   \"traditional\": \"蘋果\",\n//   \"simplified\": \"苹果\",\n//   \"definitions\": {\n//     ping2 guo3\": {\n//       \"pinyin\": \"píng guǒ\",\n//       \"zhuyin\": \"ㄆㄧㄥˊㄍㄨㄛˇ\",\n//       \"translations\": [\n//         \"apple\"\n//       ],\n//       \"classifiers\": {\n//         \"ge4\": {\n//           \"traditional\": \"個\",\n//           \"simplified\": \"个\",\n//           \"pinyin\": \"gè\"\n//         },\n//         \"ke1\": {\n//           \"traditional\": \"顆\",\n//           \"simplified\": \"颗\",\n//           \"pinyin\": \"kē\"\n//         }\n//       }\n//     }\n//   }\n// }\n\nmdbg.get('吗') // mdbg.getByHanzi('吗')\n.then(console.log)\n// {\n//   \"traditional\": \"嗎\",\n//   \"simplified\": \"吗\",\n//   \"definitions\": {\n//     \"ma3\": {\n//       \"pinyin\": \"mǎ\",\n//       \"zhuyin\": \"ㄇㄚˇ\",\n//       \"translations\": [\n//         \"see 嗎啡|吗啡, morphine\"\n//       ]\n//     },\n//     \"ma5\": {\n//       \"pinyin\": \"ma\",\n//       \"zhuyin\": \"ㄇㄚ˙\",\n//       \"translations\": [\n//         \"(question particle for \\\"yes-no\\\" questions)\"\n//       ]\n//     }\n//   }\n// }\n\nmdbg.get('wo3') // mdbg.getByPinyin('wo3')\n.then(console.log)\n// [\n//   {\n//     \"traditional\": \"我\",\n//     \"simplified\": \"我\",\n//     \"definitions\": {\n//       \"wo3\": {\n//         \"pinyin\": \"wǒ\",\n//         \"zhuyin\": \"ㄨㄛˇ\",\n//         \"translations\": [\n//           \"I\",\n//           \"me\",\n//           \"my\"\n//         ]\n//       }\n//     }\n//   },\n//   {\n//     \"traditional\": \"婐\",\n//     \"simplified\": \"婐\",\n//     \"definitions\": {\n//       \"wo3\": {\n//         \"pinyin\": \"wǒ\",\n//         \"zhuyin\": \"ㄨㄛˇ\",\n//         \"translations\": [\n//           \"maid\"\n//         ]\n//       }\n//     }\n//   }\n// ]\n\nmdbg.get('ㄒㄧˇㄏㄨㄢ˙') // mdbg.getByZhuyin('ㄒㄧˇㄏㄨㄢ˙')\n// .then(console.log)\n// [\n//   {\n//     \"traditional\": \"喜歡\",\n//     \"simplified\": \"喜欢\",\n//     \"definitions\": {\n//       \"xi3 huan5\": {\n//         \"pinyin\": \"xǐ huan\",\n//         \"zhuyin\": \"ㄒㄧˇㄏㄨㄢ˙\",\n//         \"translations\": [\n//           \"to like\",\n//           \"to be fond of\"\n//         ]\n//       }\n//     }\n//   }\n// ]\n\nmdbg.getIndexByPinyin('shui3')\n.then(console.log)\n// [ \"水\", \"氵\", \"氺\" ]\n\nmdbg.getIndexByZhuyin('ㄍㄨㄛˇ')\n.then(console.log)\n// [ \"惈\", \"槨\", \"猓\", \"粿\", \"菓\", \"蜾\", \"裹\", \"輠\", \"餜\" ]\n```\n\n## Related\n\n- [`pinyin-utils`](https://github.com/pepebecker/pinyin-utils)\n- [`pinyin-split`](https://github.com/pepebecker/pinyin-split)\n- [`zhuyin`](https://github.com/pepebecker/zhuyin)\n- [`find-hanzi`](https://github.com/pepebecker/find-hanzi)\n- [`hsk-words`](https://github.com/pepebecker/hsk-words)\n- [`cedict`](https://github.com/pepebecker/cedict)\n- [`pinyin-or-hanzi`](https://github.com/pepebecker/pinyin-or-hanzi)\n- [`hanzi-to-pinyin`](https://github.com/pepebecker/hanzi-to-pinyin)\n- [`pinyin-convert`](https://github.com/pepebecker/pinyin-convert)\n- [`pinyin-rest`](https://github.com/pepebecker/pinyin-rest)\n- [`pinyin-api`](https://github.com/pepebecker/pinyin-api)\n- [`pinyin-bot-core`](https://github.com/pepebecker/pinyin-bot-core)\n- [`pinyin-telegram`](https://github.com/pepebecker/pinyin-telegram)\n- [`pinyin-messenger`](https://github.com/pepebecker/pinyin-messenger)\n- [`pinyin-line`](https://github.com/pepebecker/pinyin-line)\n- [`pinyin-chrome`](https://github.com/pepebecker/pinyin-chrome)\n- [`pinyin-cli`](https://github.com/pepebecker/pinyin-cli)\n- [`hanzi-cli`](https://github.com/pepebecker/hanzi-cli)\n\n## Contributing\n\nIf you **have a question**, **found a bug** or want to **propose a feature**, have a look at [the issues page](https://github.com/pepebecker/mdbg/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepebecker%2Fmdbg","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepebecker%2Fmdbg","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepebecker%2Fmdbg/lists"}