npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@fork-anyone/node-nim

v9.16.6

Published

NetEase IM nodejs wrapper based on NetEase IM C++ SDK

Downloads

26

Readme

NetEase Electron IM SDK

codecov GitHub all releases
中文
API Document

Table of Contents

Introduction

node-nim is a Node.js wrapper for the NetEase IM PC SDK, enabling you to utilize all of its features in your preferred frontend framework with native platform performance.
For comprehensive documentation, changelog, and technical support, please visit https://dev.yunxin.163.com/.

Runtime Requirements

| Runtime | Version | | -------- | ----------- | | Electron | >= v8.5.5 | | Node.js | >= v12.13.0 |

System Requirements

| System | Requirements | | ------- | ------------- | | Windows | >= Windows 7 | | macOS | >= 10.14.0 | | Linux | glibc >= 2.23 |

Supported Platforms

| Platform | Architecture | | -------- | ------------ | | Windows | x64 | | Windows | ia32 | | macOS | x64 | | macOS | arm64 | | Linux | x64 | | Linux | arm64 |

Installation

node-nim is an NPM package that can be installed using the npm install command.
It will automatically download the prebuilt binary file that fits your current platform.

npm install node-nim --save-dev

Maybe you need to build ia32 app on x64 platform or something like that, you can use --arch and --platform to specify the platform you want to build.

  • Windows x64
npm install node-nim --save-dev --arch=x64 --platform=win32
  • Windows x86
npm install node-nim --save-dev --arch=ia32 --platform=win32
  • macOS x64
npm install node-nim --save-dev --arch=x64 --platform=darwin
  • macOS arm64
npm install node-nim --save-dev --arch=arm64 --platform=darwin
  • Linux x64
npm install node-nim --save-dev --arch=x64 --platform=linux
  • Linux arm64
npm install node-nim --save-dev --arch=arm64 --platform=linux

Build From Source

Technically, native nim sdk is shipped with a prebuilt node-nim.node binary file, so there is no need to build it yourself..
But if you want to add personal features or simply prefer to do so, feel free to build it!
Build Requirements:

  • Node.js
  • npm
  • CMake
  • CMake supported generator(Unix Makefiles, Ninja, Visual Studio, Xcode...)

Now you are all set to build, run following commands in the root directory of the project:

cmake -S . -B build
cmake --build build --config Release

And voilà, you now have your own node-nim binary file in the build directory.

Quick Start

import * as node_nim from 'node-nim'

Initialize SDK

const result = node_nim.nim.client.init('appkey', '', '', {
    database_encrypt_key_: 'abcdefghijklmnopqrstuvwxyz012345'
})
if (result) {
    node_nim.nim.initEventHandlers() // init event handlers
    node_nim.nim.talk.on('receiveMsg', (result) => {
        console.log('receiveMsg', result)
    })
    node_nim.nim.talk.on('sendMsg', (message: node_nim.IMMessage) => {
        console.log('sendMsg: ', message)
    })
    // add more event handlers here
    // ...
}
return result

Login

let [loginResult] = await node_nim.nim.client.login('appkey', 'account', 'password', null, '')
if (loginResult.res_code_ == node_nim.NIMResCode.kNIMResSuccess) {
    console.log('login succeeded')
} else {
    console.log('login failed')
}

Send Message

node_nim.nim.talk.sendMsg(
    {
        session_type_: node_nim.NIMSessionType.kNIMSessionTypeP2P,
        receiver_accid_: 'receiver',
        type_: node_nim.NIMMessageType.kNIMMessageTypeText,
        content_: 'Send from NIM node quick start.'
    },
    ''
)