Socket
Socket
Sign inDemoInstall

cccount

Package Overview
Dependencies
0
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    cccount

Ultra fast Chinese character counter


Version published
Weekly downloads
10
increased by25%
Maintainers
1
Install size
44.4 kB
Created
Weekly downloads
 

Readme

Source

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)
  • data: the article to be caculated.
  • options
  • strict: false - normal mode, true - strict mode
  • callback: the complete callback function

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

  • lengthChinese: the Chinese characters

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

  • Publishing platform for caculating and display Chinese characters
  • Database schema design for storing Chinese words in the JSON document
  • You want to caculate Chinese words for more exact

License

The MIT License (MIT)

FAQs

Last updated on 11 Jul 2016

Did you know?

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc