next-update answers the question: “Is it safe to upgrade my npm module’s dependencies?” #

Upgrading your library’s dependencies can be a scary proposition. Not upgrading your library’s dependencies can be even scarier. Thankfully, next-update is here to help. Let’s imagine:

You would like to update lodash and async to latest versions, but not sure if this would break anything. With next-update it is easy.

You run the next-update command and it tells you whether or not updating any of your dependencies breaks you tests. If you don’t have tests, I guess you should go write some…

Trash – a safer and cross-platform `rm` #

Instead of permanently deleting files from the command line, this little tool moves them to the trash.

Like me, you might be thinking, “But I can do the same thing with mv.” To this Sindre writes:

Not really. The mv command isn’t cross-platform and moving to trash is not just about moving the file to a “trash” directory. On all OSes you’ll run into file conflicts. The user won’t easily be able to restore the file. It won’t work on an external drive. The trash directory location varies between Windows versions. For Linux there’s a whole spec you need to follow. On OS X you’ll loose the Put back feature.

Who knew?

A Hapi Ninja for Node.js #

Earlier this year we had Eran Hammer on the podcast to talk about the success of Node.js at Walmart for the infamous influx of traffic that Black Friday brings them. At the core of their success lies Hapi, the rich framework for building web applications and services with Node from Walmart Labs.

Hapi is a lot like Sinatra for Ruby in the fact that you start with a single server file and expand as needed from there to create a file and directory structure to organize and support your application code.

While hacking on Hapi recently, I found Hapi Ninja. If you’re just getting started like me, Hapi Ninja can serve as a boilerplate to learn from with Hapi, or even as the starting point for your Node web service.

It was also a pleasant surprise to see Saul Maddox was a native Houston Texan like myself. Sadly we’ve never met.

Metalsmith: a static site generator with lots of potential #

Segment.io’s Metalsmith doesn’t excite me because it’s a static site generator. It excites me because its everything-is-a-plugin philosophy turns it in to a potential swiss army knife for any project that manipulates a directory of files.

It could be a project scaffolder. It could be an e-book generator. It could be a build tool. It could be a documentation tool. It could be something I’ve never even heard of before.

Check out their examples to whet your imagination.

Quickly reduce the amount of data your node API returns #

When designing an API, it’s easy to forget that not everyone has a cable modem. What if a client could easily request exactly the data it needed. That is what JSON Mask aims to do.

This is a tiny language and an engine for selecting specific parts of a JS object, hiding/masking the rest.

A code example helps to demonstrate how this works.

var mask = require('json-mask')
mask({p: {a: 1, b: 2}, z: 1}, 'p/a,z')  // {p: {a: 1}, z: 1}

JSON Mask seems like an interesting way to reduce the amount of data we send down the pipes.

Node mock in-memory file system for testing #

In Node, the fs module provides file system access. Tim Schaub’s mock-fs module allows Node’s built-in fs module to be temporarily backed by an in-memory file system during testing.

From Tim’s post Mocking the file system:

When writing tests, it’s common to run up against code that relies on file system access. People often end up including a bunch of test fixtures along with their code. Tests might create some temporary space, copy fixtures in place, run code, make assertions about what was read or written, and then clean up. The result can be fragile when working across multiple operating systems and leads to long test run times. In cases like this, a mock file system provides an alternative.

Checkout the source on GitHub.

#113: Scale npm with Isaac Schlueter and Charlie Robbins

Adam talks with Isaac Schlueter and Charlie Robbins — Isaac is the creator of npm and maintainer of Node.js, and Charlie is the Co-Founder and CEO of Nodejitsu. We talk about the “crashyness” of npm recently and the community fundraiser they are starting to ask the community to support npm and to keep it running.

Scale npm. Keep it running. Keep it awesome. #

The npm Registry needs your help.

The npm Registry has had a 10x year. In November 2012 there were 13.5 million package downloads. In October 2013 there were 114.6 million package downloads. We’re honored to have been a part of sustaining this growth for the community and we want to see it continue to grow to a billion package downloads a month and beyond.

Recently the npm registry got “crashy.” Many were not able to install, publish, or otherwise write code on npm. That’s bad.

Nodejitsu is gracefully taking the blame, and have shared the technical details on the Node.js blog. Since May 2013, when they acquired IrisCouch, Nodejitsu has operated the npm registry for the community. They’ve also taken on considerable costs in the process.

We’re a startup. We run npm because we love node and we’re very well qualified for the job. But in the last year, npm has become a giant beast of a project. We run it lean, both from an engineering and hardware perspective, because it’s just too expensive to do otherwise.

We wondered, how could we possibly get the money for the hardware and engineers to do this the right way and keep it free for the community?

That’s where you come in.

Please show your supportDonate at scalenpm.org

#111: Hoodie, noBackend and offline-first with Caolan McMahon

Andrew and Adam talk with Caolan McMahon from Hoodie to talk about very fast web development where you can build complete web apps in days, without having to worry about backends, databases or servers (with Hoodie). We discuss noBackend and the idea behind offline first.