Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

wanakana

Package Overview
Dependencies
Maintainers
1
Versions
38
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

wanakana

JS library that transliterates between japanese kana and roman letters.

  • 1.3.7
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
7.8K
decreased by-20.88%
Maintainers
1
Weekly downloads
 
Created
Source

ワナカナ <-> WanaKana <-> わなかな

Javascript library that provides utilities for detecting and transliterating Hiragana <--> Katakana <--> Romaji.

View demo site to see WanaKana in action.

Build using Grunt

  • Clone repository.
  • Install all dependencies from package.json using npm install.
  • Run grunt.
    • General development grunt default or just grunt
    • Open test suite (Mac only) grunt test
    • Deploy grunt deploy
    • Demo grunt demo - runs a deploy then copies html and opens a browser window
    • Full list of tasks grunt --help

Usage

HTML

<textarea id="ime"></textarea>

Javascript

var input = document.getElementById('ime');
wanakana.bind(input);

Documentation

// Automatically bind IME functionality to a form textarea or input.
wanakana.bind(element);

// Unbind IME from element.
wanakana.unbind(element);

// Returns false if string contains mixed characters, otherwise true if Hiragana.
wanakana.isHiragana(string);

// Returns false if string contains characters outside of the kana family, otherwise true if Hiragana and/or Katakana.
wanakana.isKana(string);

// Returns false if string contains mixed characters, otherwise true if Katakana.
wanakana.isKatakana(string);

// Convert Katakana or Romaji to Hiragana.
wanakana.toHiragana(string [, options]);

// Convert Romaji to Kana. Lowcase entries output Hiragana, while upcase entries output Katakana.
wanakana.toKana(string [, options]);

// Convert Hiragana or Romaji to Katakana.
wanakana.toKatakana(string [, options]);

// Convert Kana to Romaji.
wanakana.toRomaji(string [, options]);

// Options:
// Many functions take an optional `options` object.
// Here is the default object used for options.
{
	useObsoleteKana: false, // Set to true to use obsolete characters, such as ゐ and ゑ.
  	IMEMode: false // Set to true to handle input from a text input as it is typed.
}

Credits

Project sponsored by Tofugu & WaniKani

Contributors

Ports

The following are ports created by the community:

Keywords

FAQs

Package last updated on 19 Mar 2015

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc