{"id":20014773,"url":"https://github.com/pepebecker/pinyin-convert","last_synced_at":"2025-08-18T17:12:03.906Z","repository":{"id":20955507,"uuid":"88680759","full_name":"pepebecker/pinyin-convert","owner":"pepebecker","description":"Convert Hanzi to Pinyin and convert between Pinyin with tone marks and Pinyin with tone numbers.","archived":false,"fork":false,"pushed_at":"2023-06-16T14:37:34.000Z","size":172,"stargazers_count":18,"open_issues_count":6,"forks_count":2,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-08-12T11:38:04.651Z","etag":null,"topics":["chinese","convert","hanzi","mandarin","pinyin","tone"],"latest_commit_sha":null,"homepage":"https://www.npmjs.com/package/pinyin-convert","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/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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-04-18T23:53:04.000Z","updated_at":"2025-04-14T02:44:18.000Z","dependencies_parsed_at":"2024-06-20T23:30:45.115Z","dependency_job_id":"9b62abe0-b788-4d04-b2bf-fc8fb1c8820f","html_url":"https://github.com/pepebecker/pinyin-convert","commit_stats":{"total_commits":56,"total_committers":2,"mean_commits":28.0,"dds":"0.017857142857142905","last_synced_commit":"4b67071bab5601f55eaa64585525f6034c867fe9"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/pepebecker/pinyin-convert","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepebecker%2Fpinyin-convert","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepebecker%2Fpinyin-convert/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepebecker%2Fpinyin-convert/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepebecker%2Fpinyin-convert/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pepebecker","download_url":"https://codeload.github.com/pepebecker/pinyin-convert/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pepebecker%2Fpinyin-convert/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":271027687,"owners_count":24687082,"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","status":"online","status_checked_at":"2025-08-18T02:00:08.743Z","response_time":89,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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","convert","hanzi","mandarin","pinyin","tone"],"created_at":"2024-11-13T07:43:53.583Z","updated_at":"2025-08-18T17:12:03.876Z","avatar_url":"https://github.com/pepebecker.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Pinyin Convert\n\n[![npm version](https://img.shields.io/npm/v/pinyin-convert.svg)](https://www.npmjs.com/package/pinyin-convert)\n[![Travis Build Status](https://travis-ci.org/pepebecker/pinyin-convert.svg)](https://travis-ci.org/pepebecker/pinyin-convert)\n[![Greenkeeper badge](https://badges.greenkeeper.io/pepebecker/pinyin-convert.svg)](https://greenkeeper.io/)\n[![dependency status](https://img.shields.io/david/pepebecker/pinyin-convert.svg)](https://david-dm.org/pepebecker/pinyin-convert)\n[![dev dependency status](https://img.shields.io/david/dev/pepebecker/pinyin-convert.svg)](https://david-dm.org/pepebecker/pinyin-convert#info=devDependencies)\n[![MIT-licensed](https://img.shields.io/github/license/pepebecker/pinyin-convert.svg)](https://opensource.org/licenses/MIT)\n[![chat on gitter](https://badges.gitter.im/pepebecker.svg)](https://gitter.im/pepebecker)\n\nCheckout the [`pinyin-webinterface`](https://github.com/pepebecker/pinyin) which uses this module in the backend.\n\n## Install\n\n```shell\nnpm install pinyin-convert\n```\n\n## Usage\n\n```js\nconst convert = require('pinyin-convert')\n\nconvert('Test: wǒ de māo xǐhuān hē niúnǎi')\n.then(console.log) // Te wo3 de mao1 xi3 huan1 he1 niu2 nai3\n\nconvert('Test: wo3 de mao1 xi3huan1 he1 niu2nai3')\n.then(console.log) // Te wǒ de māo xǐ huān hē niú nǎi\n\nconvert('Test: wǒ de māo xǐhuān hē niúnǎi', { everything: true })\n.then(console.log) // Test: wo3 de mao1 xi3huan1 he1 niu2nai3\n\nconvert('Test: wo3 de mao1 xi3huan1 he1 niu2nai3', { everything: true })\n.then(console.log) // Test: wǒ de māo xǐhuān hē niúnǎi\n\nconvert('我的猫喜欢喝牛奶')\n.then(console.log)\n// [ 'wǒ ', [ 'de', 'dī', 'dí', 'dì' ], ' māo xǐ huan ', [ 'hē', 'hè' ], ' niú nǎi' ]\n\nconvert('我的猫喜欢喝牛奶', { segmented: true })\n.then(console.log)\n// [ 'wǒ ', [ 'de', 'dī', 'dí', 'dì' ], ' māo xǐhuan ', [ 'hē', 'hè' ], ' niúnǎi' ]\n\nconvert('我的猫喜欢喝牛奶', { numbered: true, segmented: true })\n.then(console.log)\n// [ 'wo3 ', ['de5', 'di1', 'di2', 'di4'], ' mao1 xǐ5huan1 ', ['he1', 'he4'], ' niu2nai3' ]\n\nconvert('Test: 我的猫喜欢喝牛奶', { everything: true, segmented: true })\n.then(console.log)\n// [ 'test: wǒ ', [ 'de', 'dī', 'dí', 'dì' ], ' māo xǐhuan ', [ 'hē', 'hè' ], ' niúnǎi' ]\n```\n\n## Related\n\n- [`pinyin-utils`](https://github.com/pepebecker/pinyin-utils)\n- [`pinyin-split`](https://github.com/pepebecker/pinyin-split)\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- [`mdbg`](https://github.com/pepebecker/mdbg)\n- [`pinyin-or-hanzi`](https://github.com/pepebecker/pinyin-or-hanzi)\n- [`hanzi-to-pinyin`](https://github.com/pepebecker/hanzi-to-pinyin)\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/pinyin-convert/issues).\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepebecker%2Fpinyin-convert","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpepebecker%2Fpinyin-convert","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpepebecker%2Fpinyin-convert/lists"}