node-icu-charset-detector
Advanced tools
Comparing version 0.0.7 to 0.1.0
@@ -1,3 +0,24 @@ | ||
var CharsetMatch = require("./build/Release/node-icu-charset-detector").CharsetMatch; | ||
var NativeCharsetMatch = require("./build/Release/node-icu-charset-detector").CharsetMatch; | ||
function CharsetMatch(buffer) { | ||
if (!(buffer instanceof Buffer)) { | ||
throw "Expected an instance of Buffer"; | ||
} | ||
this.native = new NativeCharsetMatch(buffer); | ||
} | ||
CharsetMatch.prototype = { | ||
getName: function () { | ||
return this.native.getName.apply(this.native, arguments); | ||
}, | ||
getLanguage: function () { | ||
return this.native.getLanguage.apply(this.native, arguments); | ||
}, | ||
getConfidence: function () { | ||
return this.native.getConfidence.apply(this.native, arguments); | ||
} | ||
}; | ||
function detectCharset(buffer, options) { | ||
@@ -21,2 +42,6 @@ var charsetMatch = new CharsetMatch(buffer); | ||
if (!(stream instanceof require("stream").Stream)) { | ||
throw "Expected an instance of Stream"; | ||
} | ||
function onChunkArrives(chunk) { | ||
@@ -23,0 +48,0 @@ buffer = buffer ? Buffer.concat(buffer, chunk) : chunk; |
{ | ||
"name": "node-icu-charset-detector", | ||
"version": "0.0.7", | ||
"version": "0.1.0", | ||
"main": "./node-icu-charset-detector.js", | ||
@@ -28,3 +28,6 @@ "description": "Simple binding for ICU charset detector", | ||
"node": ">=0.6" | ||
}, | ||
"dependencies": { | ||
"nan": "^1.6.2" | ||
} | ||
} |
@@ -26,3 +26,8 @@ # ICU Character Set Detection for Node.js | ||
```emerge icu``` | ||
* Fedora/CentOS | ||
```yum install libicu-devel``` | ||
#### OSX | ||
@@ -38,7 +43,6 @@ | ||
brew install icu4c | ||
ln -s /usr/local/Cellar/icu4c/<VERSION>/bin/icu-config /usr/local/bin/icu-config | ||
ln -s /usr/local/Cellar/icu4c/<VERSION>/include/unicode /usr/local/include | ||
brew link icu4c --force | ||
``` | ||
If experiencing issues with 'homebrew' installing version 50.1 of icu4c, try the following: | ||
If experiencing issues with 'homebrew' installing version 50.1 of icu4c, try the following: | ||
@@ -54,2 +58,15 @@ ```shell | ||
* From source | ||
```shell | ||
curl -O http://download.icu-project.org/files/icu4c/52.1/icu4c-52_1-src.tgz | ||
tar xzvf icu4c-4_4_2-src.tgz | ||
cd icu/source | ||
chmod +x runConfigureICU configure install-sh | ||
./runConfigureICU MacOSX | ||
make | ||
sudo make install | ||
xcode-select --install | ||
``` | ||
## Usage | ||
@@ -56,0 +73,0 @@ |
Sorry, the diff of this file is not supported yet
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
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
12646
10
54
116
1
+ Addednan@^1.6.2
+ Addednan@1.9.0(transitive)