Home

Awesome

Ultra fast Chinese character counter

cccount

Build Status npm version

cccount is a Node.js module for calculating Chinese characters.

Install

$ npm i cccount

Synopsis

Example:

var ccc = require('cccount');

// should be 2 chars
ccc.wchars("您好Hello", function (res) {
	console.log(res); // { lengthChinese: 2 }
});

Output:

{ lengthChinese: 2 }

API

ccc.wchars(data, [options,] callback)

The callback function will be called when the data has finished calculated. The callback function will get a response object,

Normally, you should run in normal mode for performance reason. If your article has some particular Chinese symbols, you can run in strict mode.

Use Cases of cccount

License

The MIT License (MIT)