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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@nebula-contrib/nebula-nodejs

v3.0.3

Published

This repository provides Nebula client API in Nodejs.

Readme

Nebula Nodejs SDK

This repository provides Nebula client API in Nodejs.

Features

  • Muti-Server Support

  • Auto-reconnection support

    Client will try to reconnect forever, until the server is available again.

  • Connection pool support

  • Disconnection detection

    A heartbeat mechanism is implemented, client will send ping to server each pingInterval ms for detect connective

  • Thrift enhancement

    fix auto reconnect issue#2407

    fix performance issue in huge data scene#2483

API

Connection Options

| parameter | type | description | | -------------- | -------- | ------------------------------------------------------------------------------- | | servers | string[] | nebula servers | | userName | string | username for login | | password | string | password for login | | space | string | space name in nebula server | | poolSize | number | Pool size for each server(Optional, default:5) | | bufferSize | number | Command cache in offline or before established connect (Optional, defaul: 2000) | | executeTimeout | number | Command executing timeout in ms (Optional, default:10000) | | pingInterval | number | for keepalive, ping duration in ms, (Optional, default:60000) |

How To

Install

For compiling C++ native module, node-gyp is required, you can install node-gyp by npm install -g node-gyp

npm install @nebula-contrib/nebula-nodejs --save --unsafe-perm

Simple and convenient API

// ESM
import { createClient } from '@nebula-contrib/nebula-nodejs'

// CommonJS
// const { createClient } = require('@nebula-contrib/nebula-nodejs')

// Connection Options
const options = {
  servers: ['ip-1:port','ip-2:port'],
  userName: 'xxx',
  password: 'xxx',
  space: 'space name',
  poolSize: 5,
  bufferSize: 2000,
  executeTimeout: 15000,
  pingInterval: 60000
}

// Create client
const client = createClient(options)

// Execute command
// 1. return parsed data (recommend)
const response = await client.execute('GET SUBGRAPH 3 STEPS FROM -7897618527020261406')
// 2. return nebula original data
const responseOriginal = await client.execute('GET SUBGRAPH 3 STEPS FROM -7897618527020261406', true)

Events

| parameter | description | | ----------------- | -------------------------------------------- | | sender | the individual connection in connection pool | | error | Nebula Error | | retryInfo | Retry information | | retryInfo.delay | delay time | | retryInfo.attempt | total attempts |

const client = createClient(options)

// connection is ready for executing command
client.on('ready', ({sender}) => {

})

// error occurs
client.on('error', ({ sender, error }) => {

})

// connected event
client.on('connected', ({ sender }) => {

})

// authorized successfully
client.on('authorized', ({ sender }) => {

})

// reconnecting
client.on('reconnecting', ({ sender, retryInfo }) => {

})

// closed
client.on('close', { sender }) => {

}

About hash64 function

nebula-nodejs exports hash64 function for converting string to string[], it's based on MurmurHash3.

// ESM
import { hash64 } from '@nebula-contrib/nebula-nodejs'

// CommonJS
// const { hash64 } = require('@nebula-contrib/nebula-nodejs')

const results = hash64('f10011b64aa4e7503cd45a7fdc24387b')

console.log(results)

// Output:
// ['2852836996923339651', '-6853534673140605817']

About Int64

nodejs cannot repreent Int64, so we convert Int64 bytes to string

// ESM
import { bytesToLongLongString } from '@nebula-contrib/nebula-nodejs'

// CommonJS
// const { bytesToLongLongString } = require('@nebula-contrib/nebula-nodejs')

const s = '-7897618527020261406'

const buffer = [146, 102, 5, 203, 5, 105, 223, 226]
const result = bytesToLongLongString(buffer)

// result equals s

Development

Build

git clone https://github.com/nebula-contrib/nebula-node.git
cd nebula-node
npm install --unsafe-perm
npm run build

Unit Test

npm run build
npm run test

Unit Test Coverage

npm run coverage

Publish

npm run build
cd dist
npm publish

TODO

Not implemented data type for auto parser

| Data Type | property name in nebula response | | --------- | -------------------------------- | | DataSet | gVal | | Geography | ggVal | | Duration | duVal |

Released Versions in npmjs.com

| NodeJS Client Version | Nebula Graph Version | | --------------------- | --------------------- | | 2.6.2 | 2.6.x | | 3.0.2 | 3.x |