Section 1: Overview of Node.js on IBM i
Every RPG Programmer should understand Node.js
Grab a cup of tea (or something stronger, I won't judge) because we are about to do something that would have made my 1990s green-screen self spit out his coffee: we are going to run JavaScript on the IBM i.
Yes. JavaScript. On the AS400. iSeries. System i. IBM i. Whatever you call it in your shop - I still say AS400 when nobody is looking.
So what is Node.js?
Node.js is a JavaScript runtime built on Google's V8 engine - the same engine inside Chrome. Somebody clever (Ryan Dahl, back in 2009) ripped the engine out of the browser and let it run on a server. That means:
- JavaScript can read files, open sockets, talk to databases and serve web pages.
- It ships with npm, the largest package library on the planet. Need to send email, parse a CSV, generate a PDF? There is a package for that. Probably twelve.
- It runs on Linux, Windows, macOS... and, thanks to IBM's open source team, IBM i (in the PASE environment).
Where does it live on IBM i?
Node.js runs in PASE (Portable Application Solutions Environment) - the AIX-compatible runtime that sits alongside ILE on your box. You install it with the open source package manager (yum) and it lands under /QOpenSys/pkgs/. We will do all of that, step by step, in Section 3.
Crucially, it isn't a "foreign" box bolted on the side. Node.js on IBM i can:
- Run SQL directly against Db2 for i (via the
odbcoridb-connectorpackages). - Call RPG/CL programs, commands and service programs (via
itoolkitand XMLSERVICE). - Read and write the IFS like any other file system.
What we'll build in this course
By the end of the course you'll have a working web application - a food ingredients database with Create, Read, Update and Delete - running on your IBM i, written in Node.js, talking to a real Db2 for i table. Here is the roadmap:
- Overview (you are here)
- Advantages of Node.js compared with RPG, Java, Python and PHP
- Installing Node.js, npm and the database drivers
- Building web services with Express and the IBM i toolkit
- The CRUD application, from SQL DDL to a browser front end
Right, enough waffle. Onwards!
