Node.js Icon

Node.js

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

Natasha Lekh crawlee.dev

Crawlee is a web scraping & browser automation library for Node.js

Here’s Natasha Lekh from Apify describing the project:

This project really is a culmination of 4 years of work trying to make the best library for web scraping in production. Web scraping is a very dynamic environment and what works today might not work tomorrow, so we at Apify had to go through a lot of trial and error to figure out the most reliable and convenient ways of crawling the web and scraping data. We hope that we finally cracked it and that now many developers will enjoy working with our new library and it will make their scrapers more reliable and time to production faster.

I like how it starts with simple HTTP-based scraping, but can switch to browser-based automation when a site has JavaScript rendering. I don’t love the built-in proxy rotation features. Not because they’re bad, per se, but because they make spammers lives easier…

TypeScript github.com

A headless, code-first CMS built with TypeScript

This looks very opinionated with the tech it chooses (Node, Express, MongoDB, React, TypeScript). But if you like those choices, that probably means you’ll like what they’ve cooked up.

  • Payload gives you everything you need, but then steps back and lets you build what you want in JavaScript or TypeScript - with no unnecessary complexity brought by GUIs. You’ll understand how your CMS works because you will have written it exactly how you want it.
  • Bring your own Express server and do whatever you need on top of Payload. Payload doesn’t impose anything on you or your app.
  • Completely control the Admin panel by using your own React components. Swap out fields or even entire views with ease.
  • Use your data however and wherever you need thanks to auto-generated, yet fully extensible REST, GraphQL, and Local Node APIs.

Node.js spin.atomicobject.com

Why I prefer Makefiles over package.json scripts

John Ruble:

On any moderately-sized Node.js project you’ve likely already outgrown the package.json “scripts” section. But because the growth was gradual, with no single acute pain point, you might not have noticed. There’s a better way.

I’ve never been able to get into Makefiles, but many people I respect love them. For me the syntax is too arcane, but I recognize the power. If the “scripts” section of your package.json is getting unwieldy, it might be time for a make over. (yes I went there)

Rails nikodunk.com

From Node to Ruby on Rails

A post from back in June resurfaced this week in light of the big Rails 7 release.

I learned to code in the JavaScript stack and am building a JavaScript based product. I never questioned this stack: many companies default to it, JS everywhere seems good, and the community is big. But for my new side project I decided to try Rails because despite some perception that Ruby on Rails is ‘over’, people in HN comments say it was somehow more enjoyable than the newer Node based stack. Having tried it I can say wow - coming from the current Javascript ecosystem makes discovering Rails a revelation.

If you make your technology choices because of “perception that $TECHNOLOGY is ‘over’”, you are missing out on a world of potentially great options.

JS Party JS Party #197

Fastify served with a refreshing Pino 🍷

Matteo Collina, Ph.D takes us to school on all things Node, Fastify, and Pino. We start with his journey into the Node community, how he got started in open source, and his experience as a member of Node’s Technical Steering Committee (TSC). We then nerd out about middleware architecture, data structures and logs (yes, logs), and of course, we dive into what makes Fastify so darn fast and how Pino was the precursor project.

Node.js github.com

Node `timers/promises` for browser and server

Node recently introduced timers/promises API which provides functionality such as setTimeout and setInterval but using Promises. Developers usually achieved that functionality with various 3rd-party packages but now they have full STD support with additional features like native cancellation.

So, I thought it would be useful to have that same API available in browsers (even down to IE11) and older Node versions!

Liran Tal github.com

The largest Node.js CLI Apps best practices list ✨

A bad CLI can easily discourage users from interacting with it. Building successful CLIs requires attention to detail and empathy for the user in order to create a good user experience. It is very easy to get wrong.

In this guide I have compiled a list of best practices across areas of focus which aim to optimize for an ideal user experience when interacting with a CLI application.

Changelog Interviews Changelog Interviews #443

Exploring Deno Land 🦕

This week we’re joined by Ryan Dahl, Node.js creator, and now the creator of Deno - a simple, modern and secure runtime for JavaScript and TypeScript that uses V8 and is built in Rust.

We talk with Ryan about the massive success of Node and how it impacted his life, and how he eventually created Deno and what he’s doing differently this time around. We also talk about The Deno Company and what’s in store for Deno Deploy.

Node.js github.com

google/zx – a tool for writing better scripts

Bash is great, but when it comes to writing scripts, people usually choose a more convenient programming language. JavaScript is a perfect choice, but standard Node.js library requires additional hassle before using. zx package provides useful wrappers around child_process, escapes arguments and gives sensible defaults.

I wouldn’t say JavaScript is a perfect choice for this kind of scripting, but it’s definitely a suitable one (especially if it’s the language you already know well). Here’s what scripting looks like with zx:

#!/usr/bin/env zx

await $`cat package.json | grep name`

let branch = await $`git branch --show-current`
await $`dep deploy --branch=${branch}`

await Promise.all([
  $`sleep 1; echo 1`,
  $`sleep 2; echo 2`,
  $`sleep 3; echo 3`,
])

let name = 'foo bar'
await $`mkdir /tmp/${name}`

Top-level await sure makes things nicer. (Deno supports this out of the box, btw.)

Node.js acco.io

I finally escaped Node (and you can too)

This is one of the least ranty “I’ve switched from X to Y” posts I’ve read and it’s filled with knowledge regarding the importance of data structures:

If you have solid foundation, the house will come with little effort. If the foundation is mud and sticks on top of a trash heap, your life as a builder is going to be complicated.

This principle applies to tools in a broader sense. You want to do the least work possible when swinging a sledgehammer, so you design it such that the hammer is a much heavier material than the handle. This gives you leverage. If you designed your sledgehammer in the inverse, you’d have to swing it harder every time you used it.

TypeScript tRPC.io

A TypeScript toolkit for building end-to-end typesafe data layers

tRPC doesn’t generate code for you, add functions to your run-time, or require any additions to your build pipeline. It simply allows your client code to be aware of your server-side type annotations and declarations so you can have type-safety and autocompletion inferred from its API paths, input/output data, and errors.

A TypeScript toolkit for building end-to-end typesafe data layers

Node.js jam.systems

Jam is an OSS alternative to Clubhouse and Twitter Spaces

With Jam you can create audio rooms that can be used for panel discussions, jam sessions, free flowing conversations, debates, theatre plays, musicals and more. The only limit is your imagination.

The README has an excellent feature comparison to help you decide if Jam is right for you. They also have a PRIVACY file, which is nice to see.

Player art
  0:00 / 0:00