Functional Programming Unit Testing in Node (Part 6)

Welcome to Part 6, the final installment in this series. Below we cover unit testing the noop next, how to create pure functions that wrap noop so you can compose them, and finally using code coverage to strategically hit the last code that’s not covered.
Content
This is a 6 part series on refactoring imperative code in Node to a functional programming style with unit tests. You are currently on Part 6.

Link: https://dzone.com/articles/functional-programming-unit-testing-in-node-part-6?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Running PM2 and Node.js in Production Environments

At Stream, we build a lot of showcase and example applications to show off the awesome features that our service has to offer. For nearly all of our applications, we host them on an instance – usually DigitalOcean or AWS EC2.
While maintaining your codebase and keeping it relevant is difficult, we’ve found that the most challenging aspect when it comes to maintaining an application is keeping it alive and running. Additionally, with Node.js being the core language for most of our backend APIs, scaling a single threaded process can be hard to do; that’s where PM2 comes in and why we enjoy using it so much.

Link: https://dzone.com/articles/running-pm2-amp-nodejs-in-production-environments?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Node.js 10.0 Fills Some Gaps, Polishes a Few Rough Edges

Node.js 10 was released this April and I just wanted to kind of touch on what’s new—the additions improvements, etc. Obviously, I’m not going go through the extensive change log or anything but I just want to mention the major things. The changes are so many that you’ll find this information in series of articles elsewhere but I figured that I would wrap it up in one article and try to convey it in a simple way.
I know these aren’t the most exciting articles to read and share in the world but if you’re a JavaScript developer or someone who works at a technology firm, I think it’s really important to keep up-to-date with these things. It’ll be a short article.

Link: https://dzone.com/articles/nodejs-100-fills-some-gaps-polishes-a-few-rough-ed?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Functional Programming Unit Testing in Node (Part 5)

Noops, Stub Soup, and Mountebank
Welcome to Part 5 where we cover more about noops with a utility to test them, the “stub soup" that can happen if you don’t create small pure functions, and how we can utilize stubs instead of mocks to unit test larger functions. The most important part, though, is setting up Mountebank to show how integration tests can show problems in your unit tests despite 100% coverage. We use wrapping class instances as an example to show you the pitfalls Object Oriented Programming code can make for you.
Contents
This is a 6 part series on refactoring imperative code in Node to a functional programming style with unit tests. You are currently on Part 5.

Link: https://dzone.com/articles/functional-programming-unit-testing-in-node-part-5?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

DWeb: Social Feeds with Secure Scuttlebutt

Scuttlebutt is a free and open source social network with unique offline-first and peer-to-peer properties. Mainstream closed platforms have become a more popular way of creating and consuming content than the Web. Instead of attempting to adapt existing Web technologies for the mobile social era, Scuttlebutt offers a new platform for discourse that lets us start from scratch in designing a decentralized social ecosystem.

Link: https://hacks.mozilla.org/2018/08/dweb-social-feeds-with-secure-scuttlebutt/

NPM Can Do That?

I have been using the NPM package manager for a few years and watched it rise, almost fall (to Yarn) and evolve into a fast, full-featured package manager and much more. Along the way there are a few simple tricks that have saved me a bunch of time.
Viewing Available NPM Scripts
Picture this… you finally find some time to work on that little app or side project. It’s been days or weeks since you last looked at the code. You open up Visual Studio Code, hit CTRL-` to open the integrated terminal and type npm…? Darn, you can’t remember the command to build/run/debug/do something to your app. Time to crack open the package.json and see how it all works. Buzz kill. Wait, what about…

Link: https://dzone.com/articles/npm-can-do-that?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

High Performance Angular Grid With Web Sockets

You may have come across the requirement to push data in real-time to an Angular Grid. To push data to the browser, you need a technology called WebSocket. You can implement that using Node.js or ASP.NET SignalR. For the purpose of this article, we will use Web Sockets with Node.js.
In the first half of this article, we will create an API which will use Web Sockets to push data to the client, and, in the second half of the article, we will create an Angular application to consume that. In the Angular application, we will use Ignite UI for Angular Grid. However, you can also use a simple HTML table to consume data in real-time from the web socket. In this article, we will learn to consume data in real-time from a Node.js Web Socket in a HTML table as well as Ignite UI Angular Data Grid. We will also look at the difference in performance in these two approaches.

Link: https://dzone.com/articles/high-performance-angular-grid-with-web-sockets?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Functional Programming Unit Testing in Node (Part 4)

Welcome to Part 4 where we show how to do concurrency which is a lot easier to get “for free" using pure functions, we compose both async and synchronous functions, and we utilize a test coverage report to known where to next focus our refactoring and testing efforts.
Contents
This is a six-part series on refactoring imperative code in Node to a functional programming style with unit tests. You are currently on Part 4.

Link: https://dzone.com/articles/functional-programming-unit-testing-in-node-part-4?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev

Thoughts on Importing npm Modules to the Web as JavaScript Modules

I’ve got thoughts on the post I did about ES Modules.
“I needed a quick way import a simple module get-urls into my project. The module is well tested and it does what I needed … ignore the fact that it’s pretty easy to implement in a couple of lines of JavaScript. The problem I had is that my project is built in ES6, uses modules, and I didn’t want to have to bundle up using CommonJS (require).

Link: https://dzone.com/articles/thoughts-on-importing-npm-modules-to-the-web-as-ja?utm_medium=feed&utm_source=feedpress.me&utm_campaign=Feed%3A+dzone%2Fwebdev