Understanding Open Enterprise SDK for Node.js

Open Enterprise SDK for Node.js is a server-side JavaScript runtime environment. You can create applications and tools by using the JavaScript language and Node.js APIs, then use the Open Enterprise SDK for Node.js to deploy them onto your z/OS® system.

JavaScript is a pillar of web applications, and a familiar language to many web and front-end developers. By using JavaScript, you can use the same technology and pool of skills to build end-to-end applications (front end and back end) in the same language. JavaScript and Open Enterprise SDK for Node.js offer a versatile platform that typically improves speed of development, delivering scalable applications in fewer lines of code.

A prominent use of Open Enterprise SDK for Node.js is to develop network applications that provide a web portal or http endpoints, while orchestrating services and data in the back end. Open Enterprise SDK for Node.js provides a nonblocking, event-driven, and single-threaded approach that leverages the asynchronous I/O capabilities of z/OS to achieve scalability. Instead of having dedicated threads to handle server connections, a network request coming into the Node.js application results in an asynchronous I/O event, which triggers the corresponding handler function within the Node.js application. As a result, Node.js applications can typically scale well to many connections, while maintaining a low memory and CPU footprint.

Open Enterprise SDK for Node.js provides two main executables in the z/OS UNIX System Services (z/OS UNIX) environment - node and npm. A basic Node.js application provides an initial JavaScript file that serves as the entry point of the application, which is typically named server.js or app.js. To invoke the Node.js application, you need to execute the following command from z/OS UNIX System Services:
$ node server.js

Node.js applications are typically designed to act as microservices, which are built on top of established Node.js packages by using the built-in npm package management tool. This style of development discourages monolithic applications, and encourages better encapsulation and reuse that is amenable to agile development, micro-services, and APIs. Module dependencies are tracked within a package.json file, which also contains other versioning and metadata about the application. The npm tool parses the package.json file and installs the necessary dependencies to build the application.

Open Enterprise SDK for Node.js also supports a native add-on feature, which allows C/C++ code to be bound as part of the JavaScript module. This feature is useful for invoking native drivers or existing assets that are written in C/C++.

For an example of how to build your own sample Node.js application, refer to Building Node.js applications.