Node.js is one of the most commonly used programming languages due to its strong performance and scalability.
InterSystems IRIS® Native API for Node.js lets your application directly access the underlying data structure within InterSystems IRIS (known as globals) as well as call ObjectScript methods and routines.
To review ways to connect your application to InterSystems IRIS data platform, watch the video above.
The exercise below will walk you through the set up and execution of using Node.js to connect to InterSystems IRIS.
The Native API can be used to store data in your own custom structures to InterSystems IRIS. It can also be used to run existing InterSystems IRIS methods or routines. For this exercise, you will see how Native API allows your Node.js application to interact directly with InterSystems IRIS.
Launch the development sandbox and click the IDE link.
First, make sure you have an instance of InterSystems IRIS and a multi-language IDE ready to go.
cd /home/project git clone -b try-iris http://github.com/intersystems/quickstarts-nodejs
connections.config
file and change the value of IP
to -- cannot display value - please provision a sandbox and the value of port
to -- cannot display value - please provision a sandbox.cd /home/project/quickstarts-nodejs/Solutions
to navigate to the sample code directorynpm install --save intersystems-iris-native
to install IRIS Native API for Node.js modulenpm install readline-sync
for handling user inputnpm install file-system
for handling the file systemUse the Native API to store to a custom structure and call methods or routines.
nodeplaystockTask5.js
to view the Native API code. You will notice the connection string uses these variables to connect: const connection = irisnative.createConnection({host: ip, port: port, ns: namespace, user: username, pwd: password})
nodeplaystocksTask5.js
:cd /home/project/quickstarts-nodejs/Solutions node nodeplaystocksTask5.js
To give you the best possible experience, this site uses cookies and by continuing to use the site you agree that we can save them on your device.