0.1.1 • Published 3 years ago

netease-nim v0.1.1

Weekly downloads
-
License
ISC
Repository
-
Last release
3 years ago

NetEase IM Node.js addon wrapper

GitHub Test Badge codecov GitHub all releases

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

OptionsDescroption
fetch-wrapperDownload NIM C++ SDK source files and C binary files
build-wrapperBuild NIM C++ SDK
packagePackage the compiled artifacts
buildBuild 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