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

domino-nsf

v0.3.1

Published

Nodejs driver for Domino nsf databases

Downloads

8

Readme

Node.js driver for NSF

Install

npm install domino-nsf

Requirements

From release 0.3.0 it's a source release only, to be able to install, you'll need to follow the instructions in the development section.

Older packages is currently windows only. The binaries has been build for Win32 and tested with Node 8.9.4, 32bit.

The Notes program folder needs to be added to the system PATH.

Linux

If you want to run on Linux, you'll need to build it from source. Check out development section for more..

Usage

Async API

const domino = require('domino-nsf')();

let doc = {
  "FullName":"John Smith",
  "tags":["test","test2"],
  "age":33,
  "Form":"Person"
};

const db = domino.use('database.nsf');

db.get("documentUNID",function(error,document) {
	console.log("document",document);
});

db.insert(doc,function(error,document) {
	// returns the saved document
	console.log("document",document);
});

db.makeResponse(doc,parentDoc,function(err,res) {
	
});

db.view({view:"People",category:""},function(err,view) {
	  console.log("view result",view);
});

db.search("SELECT *", functoin(err,results) {
	//returns the search results
});

db.del("documentUNID",function(error,result) {
	console.log("result",result);
});


// to end session call
domino.termSession(); 

View parameters

{
  view: "the view name",
  max: "number, max entries to get"
  category: "the category to get"
  findByKey: "the key to search by"
  exact: true/false, exact or partial match when using findByKey
}

Synchronous API

const domino = require('domino-nsf')();

// you must run sinitThread before calling any notes api.
domino.sinitThread();
let db = domino.openDatabase('test.nsf');
let note = db.openNotesNote();
note.setItemText('Form','Test');
note.setItemText('Subject','Hello World!');

// save the note
note.updateNote();

// close the note and db
note.close();
db.close();


// terminate thread before exiting
domino.stermThread();

Avaliable methods

Domino object

sinitThread()

init the notes session/thread

stermThread()

terminate the notes thread

createDatabase('server!!path/databasename.nsf')

create a new database, on given serve and path. If path is omitted, localhost is used.
Returns a database object.

openDatabase('server!!path/databasename.nsf')

Opens a database.
Returns a database object.

deleteDatabase('server!!path/databasename.nsf');

Database object

openNotesNote('unid')

Opens a Notes note by UNID.
Returns a note object.

createNotesNote()

Creates a new note in the database.
Returns a Notes object.

getDatabaseName()

Return the database name / title.

close()

Closes the database handle.

Notes object

getItemText('itemName')

returns the items value as a string, returns empty string if item does not exists.

getItemNumber('itemName')

returns the items value as a number

getItemDate('itemName')

return item date value as js date.

getItemValue('itemName')

returns the item value as a text,number,text array or date depending on type.

getItemMime('itemName')

returns the mime item.

hasItem('itemName')

returns true/false if note has item.

getUNID()

returns the note UNID

updateNote()

saves the note to database.

setItemText('itemName','string')

set a string value to an item. If the item exists, it will replace the item value.

setItemDate('itemName', date)

set a Date object value to an item

setItemNumber('itemName,number)

set a number value to an item. If the item exists, it will replace the item value.

setItemValue('itemName', value);

set an value to an item, value can be text,number,text array or js Date object

setItemMime('itemName','header',value);

set an mime item.

appendItemValue('itemName','string')

append a string value to an existing text array.

deleteItem('itemName')

delete an item from a note.
Returns true if item was deleted.

close()

Close the note handle. After calling close, you cannot call any methods on the current Note object.

Development and Contribution

Local Development Windows

To build the addon, you need the

  • Domino C API
  • Nan for Node.js.
  • Microsoft VisualStudio 2015/2017 or by using using Microsoft's windows-build-tools
  • node-gyp

Configuring enviroment for node-gyp build

You must set these environment variables before you build the addon

NOTES_INCLUDE must contain:

  • the C API header files

NOTES_LIB must contain:

  • the path to the Notes C library folder

Linux/Docker

To set up a development enviroment using Docker, you can use this Dockerfile

Configuring and building

node-gyp configure

..and build..

node-gyp build