Node.js Icon

Node.js

Node.js is a tool for executing JavaScript in a variety of environments.
139 Stories
All Topics

The Changelog The Changelog #155

The Future of Node.js with Scott Hammond

Scott Hammond, the CEO of Joyent, joined the show to talk about the history of Node, Joyent's interest in Node, how they've handled the stewardship of Node over the years, their support of io.js joining Node Foundation, the convergence of the code bases for a stronger more inclusive Node community. At the tail end of the show, just when you think it's over, keep listening because we got Scott back on the call to discuss the news that came this week of the io.js TC voting to join Node Foundation.

read more...

Node.js Icon changelog.com

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...

read more...

Node.js Icon changelog.com

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?

read more...

Node.js Icon changelog.com

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.

read more...

Node.js Icon changelog.com

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.

read more...

Node.js Icon changelog.com

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.

read more...

Node.js Icon changelog.com

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.

read more...

Node.js Icon changelog.com

Learn the core Vim keys while playing this TRON-inspired game with your friends

Rudy Jahchan has joined two of the nerdiest things in the world — TRON and Vim — to produce something truly wonderful: vimtronner Be the last player alive by either controlling your bike safely around obstacles or enter INSERT mode to build your own walls for your opponents to crash into. Just remember, you can't do both at the same time! So much win.

read more...

Node.js Icon changelog.com

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 support -- Donate at scalenpm.org

read more...

Node.js Icon changelog.com

Prototype JSON APIs with Fortune.js

If you hadn't heard, JSON API is a format for building awesome APIs on top of JSON. You can see other posts tagged with JSON API here. Recently, a new project related to JSON API was released: Fortune.js. Fortune.js, a web framework for prototyping rich hypermedia APIs, allows you to rapidly prototype the server side of any JSON API api. Check it out: var fortune = require('fortune') , app = fortune({ db: 'petstore' }) .resource('person', { name: String, age: Number, pets: ['pet'] // "has many" relationship to pets }) .resource('pet', { name: String, age: Number, owner: 'person' // "belongs to" relationship to a person }) .listen(1337); This will give you all the proper routes and format the responses in the right way to conform with the spec. If you didn't guess, fortune.js makes heavy use of Node, so you can get it from npm: $ npm install fortune I am super pumped about projects like this, because it shows off the great benefits of standardizing around a type like JSON API. Tooling that knows how to handle the type makes it really easy to get off the ground.

read more...

Node.js Icon changelog.com

parallax.js: bringing real movement to the web

parallax.js is a lightweight parallax engine that responds to the movements from your smartphone's gyroscope and motion detection. The tool lets you specify depths and directions that determine how your webscape responds to physical movement. Creating layers is super simple, as documented: Simply create a list of elements giving each item that you want to move within your parallax scene a class of layer and a data-depth attribute specifying its depth within the scene. A depth of 0 will cause the layer to remain stationary, and a depth of 1 will cause the layer to move by the total effect of the calculated motion. Parallax.js is useable in jQuery and Zepto as a plugin, too. MIT Licensed. Browse the source code on Github.

read more...

JavaScript Icon changelog.com

Write a Date() like a human

As a person who is constantly thinking about the user's experience when interacting with my software, writing the date and time using real english such as "2 days from today", or "tomorrow at 5pm" provides the, often needed, human touch I'm looking for. Date, from Matthew Mueller, is an english language date parser for node.js and the browser that lets your users write dates like a normal human being using real english. A few examples from the readme: date('10 minutes from now') date('in 5 hours') date('at 5pm') date('at 12:30') date('at 23:35') date('in 2 days') date('tuesday at 9am') date('monday at 1:00am') date('last monday at 1:00am') date('tomorrow at 3pm') date('yesterday at 12:30am') date('5pm tonight') date('tomorrow at noon') Check out the source on GitHub or the homepage for examples and demos.

read more...
0:00 / 0:00