npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@vearvip/hanzi-readings

v1.0.5

Published

查询汉字的普通话拼音、粤语粤拼、韩语、日语、越南语的汉字发音

Downloads

12

Readme

README.md

@vearvip/hanzi-readings

简介

@vearvip/hanzi-readings 是一个方便的JavaScript库,旨在提供快速查询汉字在多种东亚语言及方言中读音的功能。此模块基于Unihan数据库构建,封装了一个简洁的API来检索包括粤语、日语、韩语、普通话及越南语在内的多种读音数据,适用于任何需要汉字多语言发音信息的应用场景。

安装

使用npm或yarn安装:

npm install @vearvip/hanzi-readings
# 或者
yarn add @vearvip/hanzi-readings

快速开始

import { queryReading } from '@vearvip/hanzi-readings';

// 查询汉字“一”的粤语、日语、韩语、普通话及越南语读音
const readings = queryReading('一');
console.log(readings);
/*
输出:
{
  kCantonese: "jat1",
  kJapaneseKun: "HITOTSU HITOTABI HAJIME",
  kJapaneseOn: "ICHI ITSU",
  kKorean: "IL",
  kMandarin: "yī",
  kVietnamese: "nhất",
}
*/

API

queryReading(character: string): Object | undefined

  • character: string - 需要查询的单个汉字。
  • 返回值: Objectundefined - 一个对象,包含了字符在不同语言/方言中的读音。如果查询的字符不存在于数据库中,则返回undefined

数据来源

本库数据源自Unicode联盟维护的权威Unihan数据库,确保了读音数据的准确性和完整性。

反馈

如果您在使用过程中遇到任何问题,或者有新功能需求和建议,欢迎通过GitHub仓库提交Issue或Pull Request,我们非常期待您的参与和反馈。


通过以上README.md,用户可以清晰地了解到@vearvip/hanzi-readings库的安装方法、基本使用示例、提供的API接口以及如何参与项目贡献,从而轻松地将其融入到自己的开发项目中。