To use denode library you need to install a windows 32-bit version of node form https://nodejs.org/en/download/ by using the msi installer. Default path should be C:\Program Files (x86)\nodejs and let node be added to the path to make thinks simpler for your self. If you plan to use many different version have a look at getting node version in Appendix A.

One time setup before you can use our packages

Before you install any pacages, you need to set up a scooped connection to our npm packages. This is a one time for each computer you plan to use any of our packages.

npm config set @dataease:registry=https://setup.2imply.com/jspackages

This will set up the @dataease scoope that you will use to get any of our pagages.

Set up project to  use denode9

To create a new node app for using denode9 and start it in vscode.

mkdir myapp
cd myapp
npm init -y
code .

To install the node api for prism (denode9):

npm install @dataease/denode9

If this is the first use of the module, you must also copy the given $4tp$.key license file into the directory given in your prisminit function call.

The api can only be used with LE9/DE9 applications as this is the version of prism supported by denode9 package.

After this you simply need to initialize and use the library like this

const {prism, prisminit, Repo} = require('@dataease/denode9');

let repo = null;

let res = prisminit('C:\\ProgramData\\ds2imply');
if (res){
  console.log('Prism started using license: ' + prism.runfunction("DEOS", "@getlicense"));
  repo = new Repo();
  const res = repo.openrepo('HeaderFooterSizeToFit', 'C:\\Data\\UlrikTests\\HeaderFooterSizeToFIt');
  if (res === true){
    let tables = repo.listtablenames();
    console.log(tables.join('\n'));
    let ws = repo.createmultiview('World Cities');
    repo.closerepo();
  } else {
    console.log('Error code: ' + res);
  }

} else
  console.log('Prism failed to start');

prism.prismclose();

This will first load the module and create a connection to prism. Prism need to know where the license is, so we add a license path prisminit. Then we create and open a repository. After this you can use multiviews and dqls in this repository using the api commands. When finish, make sure to close repo and shut down prism.

For debug, set your breakpoint and simply choose to launch node.js.