What's New in Mongoose 5.5: Static Hooks, Populate Match Functions

Most Recent

The 80/20 Guide to npx

April 02, 2019

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.

An Introduction to npm

March 26, 2019

npm is the de facto package manager for Node.js, roughly analagous to pip for Python or Maven for Java. There are several alternatives, like Yarn and Turbo, but npm is automatically installed when you install Node.js. The npm registry is huge, with over 800k packages at the time of this writing, so there's a package for almost everything. In this article, I'll provide a brief overview of what npm can do for you.

String Replace in JavaScript

March 21, 2019

The String#replace() function replaces instances of a substring with another substring, and returns the modified string. This function seems simple at first, but String#replace() can do a whole lot more than just replace 'foo' with 'bar'. In this article, I'll explain some more sophisticated ways to use String#replace(), and highlight some common pitfalls to avoid.

Building a Form with Vue.js

March 12, 2019

Vue has grown by leaps and bounds over the last couple years, and overtook Angular as the #2 frontend framework in 2018. According to the State of JS survey, Vue is the #1 frontend framework that isn't associated with a serial bad actor, which makes it worth learning if you're serious about going Facebook-free. In this article, I'll walk through building a simple form with Vue.

An Overview of ES6 Classes

March 05, 2019

JavaScript introduced the class keyword in 2015 with the release of ES6. React made classes an indispensable language feature when they introduced support for using extends React.Component instead of React.createClass() in 2015, and removed support for React.createClass() entirely in 2017 in favor of classes. Today, classes are a fundamental part of JavaScript, and many new JavaScript devs don't remember a time before classes. In this article, I'll provide an overview of how classes work in JavaScript: how to declare classes, what features JavaScript provides with classes, and how inheritance works.

How find() Works in Mongoose

February 26, 2019

There's some confusion on the internet about what happens when you call Model.find() in Mongoose. Make no mistake, Model.find() does what you expect: find all documents that match a query. But there's some confusion about Model.find() vs Query#find(), setting options, promise support. In this article, I'll provide a conceptual overview of what happens when you call Model.find() so you can answer similar questions for yourself.