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

@vision-dbms/connect

v1.0.2

Published

Vision external adapter for nodejs

Downloads

15

Readme

A node.js native add-on for the Vision database management system:

var vc=require('@vision-dbms/connect')
var p=vc.v ('2 + 2'). then (r=>console.log (r))

>     4.00


var myObject = {}
var p=vc.v ('JS set: "x" to: 23.7; JS set: "y" to: "Hello, world..."',myObject)
var t=p.then (r=>console.log (myObject))

> { x: 23.7, y: 'Hello, world...' }

Prerequisites

The documentation that follows assumes:

Installation

This node module is available from the npm registry as @vision-dbms/connect:

npm install @vision-dbms/connect

Because @vision-dbms/connect is a native add-on for node, it contains C++ code that must be compiled. npm install does that automatically, provided the required development tools are present on the system. If that system is a Linux or macOS host that has already been used to build Vision (perhaps the staging-nodejs-connect branch mentioned above), the required tools and header files will already be present.

If the system you are using has not been used to build Vision, you may need to install the required development tools and, in the case of Linux systems, some additional system header files. An authoritative list of the tools you need to install can be found in the documentation for node-gyp (note that you do not need to install node-gyp, just its recommendations).

For Linux systems, you may also need to install header files for the system's UUID generator. For Red Hat based systems (RHEL, Centos, etc.), the command you most likely will need to run is:

sudo yum install libuuid-devel

while on Debian based systems (Debian, Ubuntu, etc.), that command will most likely be:

sudo apt install uuid-dev

Use

The Basics

To access @vision-dbms/connect, load it using require:

var vc=require('@vision-dbms/connect')

At its most basic, @vision-dbms/connect gives you the ability to execute Vision expressions using its v method:

var p = vc.v ('2 + 2')

v operates asynchronously, scheduling evaluation of its expression, returning a JavaScript Promise for the output of that expression.

Promises are a major feature and paradigm of JavaScript programming. They are described in great depth on the web (here, for example). What you need to know to get started is that Promises have a then method that takes two functions as arguments, one that will be called with a successfully returned result and one that will be called in case of an error:

var p = vc.v ('2 + 2').then(result=>console.log ('Success: ', result), error=>console.error('Failure: ', error))
> Success:       4.00

A bit of noteworthy magic is happening here. The v method knows where to evaluate its expression courtesy of Vision's session configuration files. Found at common user specific and environment variable (e.g., VcaGlobalSessionsFile, VcaSessionsFile) specified locations, those files are used to create a directory of known servers, services, and process creation templates. By default, @vision-dbms/connect searches that session directory for an entry named NodeEvaluator. It also includes, for its own use in environments that do not define their own session configuration, a very basic NodeEvaluator definition that expects to find a runnable batchvision on the current path:

In a bare environment, if you do nothing else except make sure that batchvision can be found along with a Vision database it can use, the examples documented here should work.