Build of this native module should be made inside of the client-sdk.
The result of the build are native modules for the node and for the electron,
which must be packetized and placed on the public available HTTPS-capable host.
All stages will be considered in detail below.


--- REQUIREMENTS ---
- Prebuilt client-sdk and 3rdparty libraries for the desired platform and architecture.
- NodeJS installed
- build environment

Also please note that build is slightly different depending on the platform.


********** For *nix-like including MacOS and Linux **********


--- BUILD ---
cd client-sdk/src/nodejs/vn-player
npm install --build-from-source
./node_modules/.bin/node-pre-gyp rebuild --runtime=electron --target=7.0.0-beta.4


--- PACKAGE ---
npm pack
./node_modules/.bin/node-pre-gyp package
./node_modules/.bin/node-pre-gyp package --runtime=electron --target=7.0.0-beta.4

As a result we have one tarball in ./ and two in build/stage .
We need to copy them manually to the public available HTTPS-capable host.
I chose our ftp for this purpose: ftp.videonext.net

Examples for x86_64-darwin arch:

scp vn-player-1.0.0.tgz <user>@ftp.videonext.net:/ftp/data/private/native-addons/
scp build/stage/node-darwin-x64.tar.gz <user>@ftp.videonext.net:/ftp/data/private/native-addons/vn_player/v1.0.0/
scp build/stage/electron-darwin-x64.tar.gz <user>@ftp.videonext.net:/ftp/data/private/native-addons/vn_player/v1.0.0/

After this is done, we can use our native module by adding it via url to some package.json:

...
"dependencies": {
    "vn-player": "https://ftp.videonext.net/private/native-addons/vn-player-1.0.0.tgz",
...


--- TEST ---
You can run the test script using any of the following commands:

npm test
node test.js
