Understanding IBM SDK for Node.js - z/OS

The IBM® SDK for Node.js - z/OS® 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 SDK 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. With SDK for Node.js - z/OS, the same skills and code can now be shared to create an end-to-end JavaScript stack. JavaScript and SDK for Node.js - z/OS offer a versatile platform that typically improves speed of development, delivering scalable applications in fewer lines of code.

A prominent use of IBM SDK for Node.js - z/OS is to develop network applications that provide a web portal or http endpoints, while orchestrating services and data in the backend. SDK for Node.js - z/OS provides a non-blocking, event-driven, single-threaded approach that exploits z/OS's asynchronous I/O capabilities to achieve scalability. Instead of having dedicated threads to handle server connections, a network request coming into the Node.js application will result in an asynchronous I/O event, which will then trigger the corresponding handler function within the Node.js application. As a result, Node.js applications can typically scale well to large number of connections, while maintaining low memory and CPU footprint.

The IBM SDK for Node.js - z/OS 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:
$> node server.js

Node.js applications tend to be developed in smaller modules that are managed by the built-in npm tool. This style 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 meta-data about the application. The npm tool will parse the package.json file and install the necessary dependencies to build the application.

IBM SDK for Node.js - z/OS 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 not written in JavaScript language. The SDK for Node.js - z/OS includes a 64-bit C/C++ compiler (njsc/njsc++) with C++11 language support to facilitate the compilation of native add-on modules.

For an example of how to build your own sample Node.js application, refer to Getting started with IBM SDK for Node.js - z/OS.