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

ivs

v2.0.2

Published

This module supplies basic mutual IVS conversion between Adobe-Japan and Hanyo-denshi(Moji_Joho)

Downloads

61

Readme

IVS.js

Build Status Greenkeeper badge

Node.js module that supplies mutual IVS conversion between Adobe-Japan and Hanyo-denshi(Moji_Joho).

This package includes database for mutual conversion of IVS, which is generated from GlyphWiki's aliasing information.

Install

npm install ivs

Use

var IVS = require('ivs');
var ivs = new IVS(function () {
    ivs.HD('葛󠄁飾󠄀区󠄀'); // -> '葛󠄃飾󠄂区󠄀'
});

Usage

new IVS([options], [callback])

Constructor.

  • options: Object, options.
    • options.ivd: String, the path to ivd.json file. Valid only in browser. Default is the same directory to the ivs.js file.
  • callback: Function(error), called when IVS converter is ready.
    • error: Error, supplied if construction failed.

ivs.unify(category, string)

Unify IVSes in the given string to the given type

  • category: String, The IVS category to which the IVSes will be unified to. 'AJ' and 'HD' are supported.
  • string: String, to convert.
  • Returns: String, IVS-Unified string

ivs.AJ(string)

Unify IVSes in given string to Adobe-Japan1. Alias to IVS.unify('AJ', string).

  • string: String, to convert.

ivs.HD(string)

Unify IVSes in given string to Hanyo-Denshi. Alias to IVS.unify('HD', string).

  • string: String, to convert.

ivs.strip(string, [options])

Completely strip IVSes from given string.

  • string: String, to convert.
  • options: Object, options.
    • options.resolve: Boolean, Some of the default glyphs in GlyphWiki is linked to IVDes of other code points. This option resolves mapping to other code points as conversion. Default is false.
  • Returns: String, IVS-stripped string

ivs.append(string, [options])

Append IVSes for non-IVSed kanjies in given string using default glyphs in GlyphWiki.

  • string: String, to convert.
  • options: Object, options.
    • options.category: String, The IVS category used to append IVS which is the one of 'AJ', 'HD', 'AJonly', 'HDonly'. Default is 'AJ'.
    • options.force: Boolean, This option forces to append U+E0100 if default glyph was not found in IVD. Note that this doesn't affect kanjies which is not documented in IVD. Default is true.
    • options.resolve: Boolean, Some of the default glyphs in GlyphWiki is linked to IVDes of other code points. This option resolves mapping to other code points as conversion. Default is false.
  • Returns: String, IVSed string.

ivs.forEachKanji(string, callback)

Execute function for each Kanji and IVS (if exists) in given string

  • string: String, in which this function seeks for Kanji
  • callback: Function(kanji, ivs, index), called every time when Kanji was found
    • kanji: String, the IVS-stripped version of found kanji.
    • ivs: String, stacking IVS of found kanji. If no IVS is stacking, zero-length string is supplied.
    • index: Number, index of found kanji in given string.