Puppeteer is a powerful automation library for Google Chrome. With Puppeteer, you can launch a Chrome browser that you have full control over from Node.js. This makes UI testing easy: your client-side app runs in a real browser, no need to worry about the painful quirks of Jest attempting to mimic a browser in Node.js. Puppeteer runs in headless mode by default, which means the Chrome window isn't visible. But you can still take screenshots in headless mode, or you can disable headless mode and watch your tests click through your app.

The JSON.stringify() function is the canonical way to convert a JavaScript object to JSON. Many JavaScript frameworks use JSON.stringify() under the hood: Express' res.json(), Axios' post(), and Webpack stats all call JSON.stringify(). In this article, I'll provide a practical overview of JSON.stringify(), including error cases.

Promises are a built-in concurrency primitive that's been part of JavaScript since ES6 in 2015. The Promise class has been included in Node.js since v4.0.0. That means, unless you're on an unmaintained version of Node.js, you can use promises without any outside libraries.

Private class fields are a Stage 3 TC39 proposal. Even though they're still experimental, you can use private class fields in Node.js 12 without flags or transpilers. In this article, I'll explain the basics of private class fields and how they interact with existing paradigms, like Object.keys() and assert.deepStrictEqual().

When running MongoDB in production, you may see queries that should be fast, but instead are exceedingly slow. For example, my Node.js apps have seen a findOne() on a collection with only 1 document take over 1 second.

It's finally happened: nearly 4 years after the import keyword was introduced in ES6, Node.js introduced experimental support for ES6 imports and exports. In Node.js 12, you can use import and export in your project if you do both of the below items.

Mongoose 5.5 was released earlier this week. This release includes 12 new features and a performance improvement. The two features I'm most excited about are hooks for user-defined static functions and the ability to pass a function to populate's match option. In this article, I'll introduce these two new features and show how they can save you some design headache.

npx is a separate executable that has been shipped alongside Node.js and npm since 2017. npx is a flexible tool for running node packages that makes installing npm packages globally largely obsolete. In this article, I'll demonstrate how npx lets you avoid npm install -g, and show a couple other cool things npx can do.

Sponsored by #native_company# - Learn More
#native_title# #native_desc#
#native_cta#