Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-icu-charset-detector

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-icu-charset-detector - npm Package Compare versions

Comparing version 0.0.7 to 0.1.0

LICENSE

27

node-icu-charset-detector.js

@@ -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;

5

package.json
{
"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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc