UNPKG

1.38 kBMarkdownView Raw
1unicode-length
2--------------
3
4[![npm version](https://badge.fury.io/js/unicode-length.svg)](http://badge.fury.io/js/unicode-length)
5[![dependencies](https://david-dm.org/jviotti/unicode-length.png)](https://david-dm.org/jviotti/unicode-length.png)
6[![Build Status](https://travis-ci.org/jviotti/unicode-length.svg?branch=master)](https://travis-ci.org/jviotti/unicode-length)
7
8Installation
9------------
10
11Install `unicode-length` by running:
12
13```sh
14$ npm install --save unicode-length
15```
16
17Documentation
18-------------
19
20### Number unicodeLength.get(String input)
21
22Get the length of a unicode string.
23
24Example:
25
26```coffee
27unicodeLength = require('unicode-length')
28console.log(unicodeLength.get('汉字'))
29# Outputs 2
30```
31
32Tests
33-----
34
35Run the test suite by doing:
36
37```sh
38$ gulp test
39```
40
41Contribute
42----------
43
44- Issue Tracker: [github.com/jviotti/unicode-length/issues](https://github.com/jviotti/unicode-length/issues)
45- Source Code: [github.com/jviotti/unicode-length](https://github.com/jviotti/unicode-length)
46
47Before submitting a PR, please make sure that you include tests, and that [coffeelint](http://www.coffeelint.org/) runs without any warning:
48
49```sh
50$ gulp lint
51```
52
53Support
54-------
55
56If you're having any problem, please [raise an issue](https://github.com/jviotti/unicode-length/issues/new) on GitHub.
57
58License
59-------
60
61The project is licensed under the MIT license.