IBM SDK for Node.Js - Z/OS 14.0
Total Page:16
File Type:pdf, Size:1020Kb
IBM SDK for Node.js - z/OS 14.0 User's Guide IBM SC28-2745-00 (2021-04-27) Note Before using this information and the product it supports, read the information in “Notices” on page 41. This edition applies to version 14 of IBM® SDK for Node.js - z/OS® (order number: SC28-2745-00) and to all subsequent releases and modifications until otherwise indicated in new editions. It is our intention to update the product documentation for this release periodically, without updating the order number. If you need to uniquely refer to the version of your product documentation, refer to the order number with the date of update. Last updated: 2021-04-27 © Copyright International Business Machines Corporation 2020. US Government Users Restricted Rights – Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp. Contents Chapter 1. Expert resources...................................................................................1 Chapter 2. What's new in IBM SDK for Node.js - z/OS 14.0......................................3 Chapter 3. Overview.............................................................................................. 5 Chapter 4. Understanding IBM SDK for Node.js - z/OS............................................ 7 Chapter 5. Installing and configuring......................................................................9 Installing and configuring the SMP/E edition.............................................................................................. 9 Installing and configuring the PAX edition................................................................................................10 Chapter 6. Getting started................................................................................... 13 Chapter 7. Migrating to IBM SDK for Node.js - z/OS 14.0....................................... 15 Chapter 8. Building native add-ons...................................................................... 17 Chapter 9. Debugging.......................................................................................... 19 Chapter 10. Running IBM SDK for Node.js - z/OS.................................................. 21 Chapter 11. Verifying the env command path........................................................23 Chapter 12. Reusing code with npm community packages for Node.js................... 25 Chapter 13. Integrating Node.js with middleware and other applications on z/OS................................................................................................................27 Chapter 14. Tagging files for Enhanced ASCII support.......................................... 29 Chapter 15. Troubleshooting................................................................................ 31 Generating diagnostic report for Node.js.................................................................................................. 35 Capturing heap information.......................................................................................................................35 Generating report of storage usage by applications.................................................................................35 Chapter 16. Known issues and limitations............................................................ 37 Chapter 17. Support............................................................................................ 39 Notices................................................................................................................41 Trademarks................................................................................................................................................ 41 iii iv Chapter 1. Expert resources Business value • Blog: Node.js runs on everything...even mainframes! • Blog: Speed up your Node.js application with IBM SDK for Node.js – z/OS • Video: IBM SDK for Node.js – z/OS (Overview) Getting the offering • Blog: How to obtain IBM SDK for Node.js – z/OS, at no charge • Blog: Obtain the SMP/E edition and optional support of IBM SDK for Node.js – z/OS • Blog: Paid S&S for IBM SDK for Node.js – z/OS How-to • Blog: Accessing IBM Db2 with IBM SDK for Node.js – z/OS • Blog: Using Node.js with CICS Transaction Server for z/OS • Blog: Developing Node.js for z/OS with IBM Developer for z/OS • Blog: Creating a secure REST API with RACF key rings and the zcrypto node module • Blog: Form-based authentication using Passport and RACF Node.js npms • Video: How to build your own Native Node Module • Video: Remotely debug your IBM SDK for Node.js –z/OS application using Visual Studio Code © Copyright IBM Corp. 2020 1 2 IBM SDK for Node.js - z/OS 14.0: User's Guide Chapter 2. What's new in IBM SDK for Node.js - z/OS 14.0 IBM SDK for Node.js - z/OS 14.0 delivers the following new functions and performance and usability enhancements: • This release is based on Node.js 14.12.0 from the open-source community. • This release exploits hardware features in IBM zEC12+ and supports IBM z/OS V2R3 and above. • The installation process is simplified. A setup.sh script is introduced to validate system prerequisites, setup environment variables, and optionally install the njsc C/C++ compiler. For installation details, see Node.js v14 API reference documentation. • This release has no dependency on Perl. • The libnode DLL is versioned by using libnode.<version>.so, so you can have multiple versions of Node.js on your system. • V8 JavaScript Engine is updated to version 8.4. For more details, see the V8 JavaScript Engine release v8.4 announcement blog. • Worker threads and diagnostics reporting are now stable features. The worker threads feature can enable your application to make use of threads in JavaScript code. For the description of worker threads, see Node.js v14 API reference documentation. • Security and performance are enhanced. TLS 1.3 is now the default security protocol with OpenSSL 1.1.1g. • Node package manager (npm) is updated to 6.14.8. © Copyright IBM Corp. 2020 3 4 IBM SDK for Node.js - z/OS 14.0: User's Guide Chapter 3. Overview IBM SDK for Node.js - z/OS is an extended implementation of the Node.js runtime. Node.js extends the JavaScript programming language with a set of useful server-side APIs to provide a programming platform that allows efficient development of real-time, scalable server-side network applications. Node.js is a runtime framework that enables you to write server applications that use the syntax and structures of JavaScript. In the 2020 Stack Overflow Developer Survey, JavaScript was ranked as the most popular language and Node.js as the most popular framework. Node.js extends JavaScript by providing features such as: • The creation, modification, and deletion of local (server-side) files • Event-driven, non-blocking I/O model • Scalability • A very small "footprint" on the server • API orchestration • Web applications • Full-stack development The IBM SDK for Node.js - z/OS is a z/OS port of the open-source community Node.js and provides the following extensions: • Support for IBM z/OS, including interoperability, diagnostic, and monitoring capabilities • Additional Reliability, Availability, and Serviceability (RAS) features © Copyright IBM Corp. 2020 5 6 IBM SDK for Node.js - z/OS 14.0: User's Guide Chapter 4. Understanding IBM SDK for Node.js - z/OS 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 IBM SDK for Node.js - z/OS 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. Using JavaScript, you can leverage the same technology and pool of skills to build end-to-end applications (front-end and back-end) in the same language. JavaScript and IBM SDK for Node.js - z/OS offer a versatile platform that typically improves speed of development, delivering scalable applications in fewer lines of code, as shown by PayPal in their migration from Java™ to Node.js. 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. IBM 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 System Services: $> node server.js Node.js applications are typically designed to act as microservices, which are built on top of established node packages 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.