Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "wcwidth.js", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "A JavaScript porting of C's wcwidth() and wcswidth()", | ||
@@ -14,7 +14,7 @@ "author": { | ||
"repository": { | ||
"type": "hg", | ||
"url": "http://code.woong.org/hg/wcwidth.js" | ||
"type": "git", | ||
"url": "https://github.com/mycoboco/wcwidth.js.git" | ||
}, | ||
"bugs": { | ||
"url": "http://code.woong.org/wcwidth.js/trac", | ||
"url": "https://github.com/mycoboco/wcwidth.js/issues", | ||
"email": "woong.jun@gmail.com" | ||
@@ -21,0 +21,0 @@ }, |
@@ -1,18 +0,18 @@ | ||
wcwidth.js: A JavaScript Porting of Markus Kuhn's wcwidth() Implementation | ||
========================================================================== | ||
wcwidth.js: A JavaScript Porting of Markus Kuhn's wcwidth() Implementation | ||
========================================================================== | ||
wcwidth.js is a simple JavaScript porting of wcwidth() implemented in C by | ||
Markus Kuhn (the original implementation can be found on | ||
http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c). wcwidth() and its string | ||
version, wcswidth() are defined by IEEE Std 1002.1-2001, a.k.a. POSIX.1-2001, | ||
and return the number of columns used to represent the given wide character | ||
and string. Markus's implementation assumes the wide character given to those | ||
functions to be encoded in ISO 10646, which is almost true for JavaScript's | ||
characters. | ||
`wcwidth.js` is a simple JavaScript porting of `wcwidth()` implemented in C | ||
[by Markus Kuhn](http://www.cl.cam.ac.uk/~mgk25/ucs/wcwidth.c). | ||
For convenience, wcwidth.js sets the getter of the property named 'wcwidth' | ||
for the String type. You don't need to invoke a function to get the width of | ||
strings, but inspecting the wcwidth property is enough. The following code | ||
snippet shows how to use wcwidth.js: | ||
`wcwidth()` and its string version, `wcswidth()` are defined by IEEE Std | ||
1002.1-2001, a.k.a. POSIX.1-2001, and return the number of columns used to | ||
represent the given wide character and string. Markus's implementation assumes | ||
the wide character given to those functions to be encoded in ISO 10646, which | ||
is almost true for JavaScript's characters. | ||
For convenience, `wcwidth.js` sets the getter of the property named `wcwidth` | ||
for the string type. You don't need to invoke a function to get the width of | ||
strings, but inspecting the `wcwidth` property is enough. The following code | ||
snippet shows how to use `wcwidth.js`: | ||
var wcwidth = require('wcwidth')({ | ||
@@ -27,8 +27,8 @@ nul: 0, | ||
The argument '{ nul: 0, control: -1 }' (which are the default values, in fact) | ||
tells wcwidth.js to return 0 for the NUL character and -1 for non-printable | ||
control characters. Setting a negative value to 'nul' or 'control' makes the | ||
wcwidth property set to -1 for any string that contains NUL or control | ||
characters respectively. If you plan to replace each control character with, | ||
say, '???' when printing, you can 'require' wcwidth.js as follows: | ||
The argument `{ nul: 0, control: -1 }` (which are the default values, in fact) | ||
tells `wcwidth.js` to return 0 for the NUL character and -1 for non-printable | ||
control characters. Setting a negative value to `nul` or `control` makes the | ||
`wcwidth` property set to -1 for any string that contains NUL or control | ||
characters respectively. If you plan to replace each control character with, | ||
say, `???` when printing, you can 'require' `wcwidth.js` as follows: | ||
@@ -42,5 +42,5 @@ var wcwidth = require('wcwidth')({ | ||
wcwidth.js also provides a methods. Since JavaScript has no character type, it | ||
is meaningless to have two versions while POSIX does for C. The method also | ||
accepts a code value that can be obtained by the charCodeAt() method. | ||
`wcwidth.js` also provides a methods. Since JavaScript has no character type, | ||
it is meaningless to have two versions while POSIX does for C. The method also | ||
accepts a code value that can be obtained by the `charCodeAt()` method. | ||
@@ -51,5 +51,6 @@ console.log(wcwidth('한')); // prints 2 | ||
For the copyright issues, see the accompanying LICENSE file. | ||
`INSTALL.md` explains how to build and install the library. For the copyright | ||
issues, see the accompanying `LICENSE.md` file. | ||
If you have a question or suggestion, do not hesitate to contact me via email | ||
<woong.jun@gmail.com> or web <http://code.woong.org/>. | ||
If you have a question or suggestion, do not hesitate to contact me via email | ||
(woong.jun at gmail.com) or web (http://code.woong.org/). |
@@ -214,2 +214,4 @@ /* | ||
assert(_.isUndefined(option) || _.isObject(option)); | ||
option = _.extend({ | ||
@@ -216,0 +218,0 @@ nul: 0, |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Non-existent author
Supply chain riskThe package was published by an npm account that no longer exists.
Found 1 instance in 1 package
17145
6
241
54
0
1