Below you can find a collection of the most important Node.js updates, tutorials & announcements from this week - curated by RisingStack's Node.js Developers.
koa-router package was just transferred to a relatively unknown user on GitHub and the package name was apparently sold.
You should version lock your
koa-router package immediately!
Currently the Guides section of the Node.js documentation does not have any documentation around security. Such a guidance would be a useful and welcome addition to the documentation.
"I would like to use this issue to solicit input both from the Security Working Group as well as from the broader Node.js community. An ideal outcome would be a list of security aspects to take into account when writing Node.js programs that we could turn into guides or a set of guides on the Node.js website." - wrote Marcin Hoppe
- Updated libuv to 1.26.0.
- Updated npm to 6.7.0.
response.writeHeadnow returns the response object.
- Implemented a histogram based API.
repl.setupHistoryfor programmatic repl.
- Introduced client "session" event.
Gajus Kuizinas created a PostgreSQL client (Slonik) with an intent to reduce repeating code patterns, protect against SQL injections and enable better developer experience. In this post he presents that client and describes the reasoning behind the design choices.
Slonik has been battle-tested with large data volumes and queries ranging from simple CRUD operations to data-warehousing needs.
Event Emitters play a very important role in the Node.js ecosystem. The EventEmitter is a module that facilitates communication/interaction between objects in Node. EventEmitter is at the core of Node asynchronous event-driven architecture.
If you follow this tutorial, you will build:
- EventEmitter class
- on / addEventListener method
- off / removeEventListener method
- once method
- emit method
- rawListeners method
- listenerCount method
The article goes through ways to handle it.
In this article Mate Boer shows how you can generate a PDF document from a heavily styled React page using Node.js, Puppeteer, headless Chrome & Docker.
NestJS is a fully-featured open-source Node.js framework that enables us to create compelling and demanding backend systems. It is currently the fastest raising Node.js framework written in Typescript.
Nest enables us to write highly testable, scalable, loosely coupled, and easily maintainable applications. To do so, it uses express under the hood. It acts as another layer on top and makes a lot of things easier for us.
This repo builds & bundles the OpenAPI Directory, so you can easily find, require and use any OpenAPI spec from the directory in your JS projects.
It provides files that can be individually required or remotely downloaded (via https://unpkg.com/openapi-directory/) for every API in the collection, and an index to quickly find the relevant OpenAPI spec for a given URL.
Deploy your Node.js app to Kubernetes with a single command. No config required.
Supports any Kubernetes cluster, including the following:
- Google Kubernetes Engine
- Amazon EKS
- DigitalOcean Kubernetes
- KubeSail (completely free Kubernetes hosting)
- Custom Clusters
This library provides common functionalities, like graceful error handling & shutdown, structured JSON logging and several HTTP middleware to make your application truly ready for modern containerised environments, like Kubernetes.
tl;dr: fnm is a very fast Node.js version manager, ~40x faster than NVM. It supports .nvmrc files and Fish shell out of the box. It works on Linux and Mac and distributed as a single executable - and it is open source on GitHub!