Registry / database / gtm
library0.1.0-56-g1b5486cjsnpmunverified

Node.js binding to the GT.M hierarchical (MUMPS) database. The current version is 0.1.0-56-g1b5486c (pre-release from git). The package wraps the GT.M C API to allow Node.js to read and write to GT.M global nodes. It uses GNP (GT.M Network Protocol) or direct call-in. Key differentiator: it is the only Node.js binding for GT.M with native bindings, but it is experimental and uses a pre-1.0 version. It requires GT.M to be installed and configured.

npm install gtm
INSTALL
IMPORT
SIG · GTM
G
gtm
databasejavascriptv0.1.0-56-g1b5486c
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

gnp
✓ const gnp = require('gtm');
✗ import gnp from 'gtm';
Package does not support ES modules; use CommonJS require.
close
✓ const { close } = require('gtm');
✗ const { close } = require('gtm').close;
close is a named export; require returns the module object.
open
✓ const { open } = require('gtm');
✗ const gtm = require('gtm'); gtm.open();
open is a top-level function, not a method on a default export.
set
✓ const { set } = require('gtm');
✗ const { set } = require('gtm/set');
set is exported from the main module, not a subpath.
get
✓ const { get } = require('gtm');
✗ const get = require('gtm').get;
Both forms work, but the named destructuring is idiomatic.

Connects to a GT.M instance, sets and retrieves a global node, then closes the connection.

const gtm = require('gtm'); const conn = gtm.open({host: process.env.GTM_HOST ?? '127.0.0.1', port: process.env.GTM_PORT ?? 1234, namespace: process.env.GTM_NAMESPACE ?? 'DEFAULT'}); gtm.set(conn, '^MyGlobal("key1")', 'value1'); const val = gtm.get(conn, '^MyGlobal("key1")'); console.log(val); gtm.close(conn); conn.close();
Debug
Known issues
breakingNative addon requires GT.M development headers and Node.js build tools; fails to install or load without them.
fix
Install GT.M (e.g., gtm, gt.m-devel) and node-gyp. Ensure GTM_DIST environment variable is set.
affects: >=0.1.0
gotchaPackage version uses git describe format (0.1.0-56-g1b5486c); npm registry may have different versioning.
fix
Use exact version from git tag or local copy if registry version is outdated.
affects: >=0.1.0
gotchaopen() requires a fully configured GT.M listener; no default parameters work out of the box.
fix
Make sure GT.M is running with proper GNP configuration (port, namespace).
affects: >=0.1.0
breakingIncompatible with Node.js versions beyond 0.12 due to deprecated V8 API usage.
fix
Use Node.js <=0.12; or fork and update nan/binding to modern N-API.
affects: >=0.1.0
gotchaset() and get() use global reference syntax; not following GT.M syntax causes runtime errors.
fix
Ensure global names start with ^ and subscripts are comma-separated in the string.
affects: >=0.1.0
Errors
Common errors & fixes
Error: Module did not self-register.
The compiled native addon is not compatible with the current Node.js version.
fix
Recompile the addon: npm rebuild gtm or use node-gyp rebuild.
Error: Could not locate the bindings file.
Missing or incorrectly built native module; package installation did not compile.
fix
Install node-gyp and required build tools, then run: node-gyp configure build within the module directory.
ReferenceError: gtm is not defined
Using require incorrectly or package not installed.
fix
Install the package: npm install gtm and use const gtm = require('gtm');
Error: connect ECONNREFUSED 127.0.0.1:1234
GT.M listener not running or wrong host/port.
fix
Start GT.M with GNP listener: gtm_gnp_server -PORT=1234 -SERVICE=^DEFAULT
Upgrade
Version history
0.1.0-56-g1b5486clatest on npm
Audit
Dependencies
nanrequiredNative Abstractions for Node.js required to compile the C++ binding.
Agent activity
13 hits · last 30 days
node
12
Resources
gtm — npm install gtm · libregistry