0.1.1 • Published 3 years ago
netease-nim v0.1.1
NetEase IM Node.js addon wrapper
Build environment
- CMake 3.10 or higher
- Visual Studio 2017 or MSBuild 2017
Installation
node-nim runs on Node.js and is available as a NPM package.
npm install node-nim --save-dev
Quick Start
const NIM = require('node-im')
const assert = require('assert')
var client = new NIM.NIMClient
const result = client.init('app_key', 'app_data_dir', 'app_install_dir', {
db_encrypt_key: 'abcdefghijklmnopqrstuvwxyz012345'
})
client.login('app_key', 'username', 'password', (result) => {
assert.strictEqual(result.err_code, 200)
}, '')
client.logout(1, (err_code) => {
done()
}, '')
client.cleanUp('')
Documentation
For more detailed documentation, the changelog, and tech support, see https://dev.yunxin.163.com/.
Build From Source
Options | Descroption |
---|---|
fetch-wrapper | Download NIM C++ SDK source files and C binary files |
build-wrapper | Build NIM C++ SDK |
package | Package the compiled artifacts |
build | Build with specified parameters (build-wrapper+package) |
Examples:
Fetch C++ wrapper source files and build C++ addon for node.js.
npx just fetch-wrapper --target_platform=win32 --target_arch=ia32
npx just build --runtime=electron --target=13.1.2 --target_platform=win32 --target_arch=ia32
Just build NIM C++ wrapper, needs npx just fetch-wrapper
before.
npx just build-wrapper --target_platform=win32 --target_arch=ia32
Packing a compiled artifact as .tar.gz
in packages
folder.
npx just package --runtime=electron --target=13.1.2 --target_platform=win32 --target_arch=ia32