diff --git a/package.json b/package.json index 82c68d4..1243d25 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "murmurhash-native", + "name": "@northpool/murmurhash-native", "description": "MurmurHash (32,64,128)bit native bindings for nodejs", "keywords": [ "murmurhash", @@ -15,13 +15,19 @@ ], "version": "3.5.0", "license": "MIT", - "author": "RafaƂ Michalski ", + "author": "luz", "contributors": [], "homepage": "http://github.com/royaltm/node-murmurhash-native", "repository": { "type": "git", "url": "git+https://github.com/royaltm/node-murmurhash-native.git" }, + "binary": { + "module_name": "murmurhash", + "module_path": "./lib/{configuration}/", + "host": "https://gitee.com/lz_code/murmurhash-native-prebuilt/releases/download/v{version}/", + "package_name": "{platform}-{arch}.zip" + }, "scripts": { "install": "node-pre-gyp install --fallback-to-build", "test": "tap -C -Rclassic ./test/test*.js ./test/types/test*.js", @@ -32,12 +38,6 @@ "tsc": "tsc -p test/types", "typedoc": "typedoc --tsconfig test/types/tsconfig.json index.d.ts promisify.d.ts incremental.d.ts stream.d.ts" }, - "binary": { - "module_name": "murmurhash", - "module_path": "./lib/{configuration}/", - "host": "https://github.com/royaltm/node-murmurhash-native/releases/download/", - "remote_path": "v{version}" - }, "main": "index.js", "types": "index.d.ts", "typeScriptVersion": "2.0", diff --git a/src/nodemurmurhash.cc b/src/nodemurmurhash.cc index ff62f72..9c5d698 100644 --- a/src/nodemurmurhash.cc +++ b/src/nodemurmurhash.cc @@ -312,6 +312,23 @@ namespace MurmurHash { static_cast(ReadOnly | DontDelete) ).FromJust(); } + + + NODE_MODULE_INIT() { + Local bigEndian = Nan::New(); + InitWithOrder(bigEndian); + Nan::Set(exports, Nan::New("BE").ToLocalChecked(), bigEndian); + + Local littleEndian = Nan::New(); + InitWithOrder(littleEndian); + Nan::Set(exports, Nan::New("LE").ToLocalChecked(), littleEndian); + + Nan::Set(exports, Nan::New("platform").ToLocalChecked(), + IsBigEndian() ? bigEndian : littleEndian); + + InitWithOrder(exports); + } + } -NODE_MODULE(murmurhash, MurmurHash::Init) +//NODE_MODULE(murmurhash, MurmurHash::Init)