1.0.0 • Published 6 years ago

vndbjs-core v1.0.0

Weekly downloads
2
License
MIT
Repository
gitlab
Last release
6 years ago

A lightweight client for communicating with the Visual Novel Database

This library is intended to provide a thin interface for the TCP API that VNDB.org offers. For more advanced data transformation options, check out vndbjs.

Features

  • Send VNDB-compatible command strings and let vndbjs-core handle the rest
  • TLS-secure connections and user login
  • Configurable ratelimiting
  • Automatic connection pooling

Connection Pooling

Vndbjs will automatically create a pool of up to 10 connections to VNDB, allowing you to maintain long-lived connections so that your commands can be sent at a moments notice while offering concurrency.

Installation

Node v8.9.4 or newer

npm install --save vndbjs-core

Usage

const Vndb = require('vndbjs');

const clientName = 'DemoApp'; // used to identify your app to VNDB.org

const config = {
  rateLimit: 20, // allows {rateLimit} writes within {rateInterval} milliseconds
  rateInterval: 60000,
  password: '********', // optional, required to perform `set` commands.
  poolMin: 2, // this many connections will be maintained at all times
  poolTimeout: 30000, // excess idle connections will be destroyed after this many milliseconds
  username: 'yourusername555' // optional, required to perform `set` commands.
}

const vndb = new Vndb(clientName, config);

vndb.send('get vn basic,details (id = 17)')
  .then((response) => {
    // data
  })

Links

Official VNDB.org Documentation

Vndbjs - Enhanced data processing and transformation

License

Vndbjs is licensed under the MIT license. This library is not associated with VNDB.org