Node.js Icon

Node.js

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

Node.js Icon hackernoon.com

A crash course on Serverless with Node.js

If you've heard of serverless' virtues, but have never taken that first step toward trying it out, this crash course is for you. Here's how you might feel by the end: What a journey. You have now witnessed the transition from traditional web development into the serverless revolution. With these simple tools we now have everything we need to create awesome, scalable, and reliable applications. In my humble opinion, this is all still too much work for most of us to go through. AWS needs some serious competition in this space. Said competition is undoubtedly on the way.

read more...

Steven Loria github.com

Making the Node.js REPL more productive

Project-specific REPLs for Node.js I'm a bit surprised this functionality isn't in the box, nonetheless: local-repl saves you from typing out imports every time you open a new Node.js REPL. You specify the modules and objects that you want to automatically import in either package.json or .replrc.js. It also lets you use await in the REPL without wrapping your code in async functions. That sounds quite nice.

read more...

Slack Icon github.com

Slack's desktop app bogging you down? Here's a speed-focused alternative.

A cross-platform, open source Slack app that's built for speed?! Shut up and take my money admiration! Wey is written in Node and the UI is powered by the Yue library, which means it's not hitchin' its wagon to Electron. But it does come with a rather large caveat: Do not use this for work, you might miss important messages due to bugs and missing features. Depending on how much you like your job, you might consider that more of a feature than a bug. 😉

read more...

Node.js Icon meowni.ca

Automatic visual diffing with Puppeteer

Monica Dinculescu: I did a little song-and-dance that sets up Puppeteer , takes screenshots of your app (like, all the routes you care about), and then compares them to the “golden” ones. If they match, your test passes! It only works with Chrome (because Puppeteer), but that's not a big deal since this is the kind of thing you only put in your devDependencies. The results are super cool in your test suite output:

read more...

Node.js Icon github.com

Zenbot

a command-line cryptocurrency trading bot using Node.js and MongoDB. This is on version 4, so a boat load of effort has been invested in this tool. In light of that, I find this statement from their README funny and somewhat sad: Zenbot 4 is functional, but is having trouble reliably making profit. At this point, I would recommend against trading with large amounts ...

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

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

JavaScript 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...
0:00 / 0:00