Automating code updates with codemods
#495 — July 18, 2023
Upgrading TypeORM with jscodeshift — TypeORM is an ORM that supports both Data Mapper and Active Record patterns, and last year it introduced some breaking changes that left the author of this post facing a lot of updates to be made. What to do? Write a ‘codemod’ to automate the job! Even if you don’t use TypeORM, this post might give you some ideas for other places to use a code rewriting approach.
Clinton Blackburn
The Leading API Platform for Building and Using APIs — Get access to a wide range of features for API testing, documentation, collaboration, mocking, and more. Automate repetitive tasks, stay organized, and build robust workflows to ensure your APIs remain reliable and performant.
Postman sponsor
Pacquet: A New, Experimental Package Manager for Node — Forget your npms, pnpms, and Yarns.. there’s a fresh face in town? Pacquet, written in Rust, is primarily a learning experiment for the author (who happens to be on Node.js core), but with package managers sharing ideas all the time, you never know..
Yagiz Nizipli
ASIDES:
Prisma 5.0 has been released and the team did ▶️ an hour long livestream showing off the improvements. There’s also a mega changelog of the various updates – performance is the name of the game for v5.
The OpenJS Foundation has shared its latest Node.js security progress report: “The Node.js team closed 17 reports in June which is a big increase from the 2 completed in May.”
GitHub is rolling out a beta of passwordless, passkey based authentication on GitHub․com.
🍩 donut.js is a JavaScript take on donut.c, a famous bit of obfuscated C.
Deploying a Fastify and Vue 3 Static Site to Heroku — One way to get the benefits of a static site architecture but retain the option to flexibly add server-side functionality later.
Liran Tal
Useful Functions for a (Deno) HTTP Server — One way to think about an HTTP-based service is functionally, with requests going in, being processed, and a response heading out. The author explores Deno’s new Deno.serve function and how both it and the /x/http_fns functions can provide a more functional approach to common HTTP tasks. Possible food for thought even in Node with things like Hono picking up pace.
Jollytoad
You Might Not Need Jest — The Node.js Native Test Runner Is Great
Paweł Grzybek
🛠 Code & Tools
YouTube.js 5.5: A Wrapper Around YouTube’s Private ‘InnerTube’ API — A year ago I wondered if this would continue to work, but apparently it does, and it uses the same behind the scenes API as official YouTube clients (you’ve gotta love the name ‘inner tube’..). As always, though, your mileage may vary.
LuanRT
fusion.ssg: A Minimal Framework for Static Websites — Think React may be overkill for a simple, static project? This new framework might be all you need. Here’s ▶️ a video demo of it in operation.
Jeff Schwartz
Your Fully Managed HTML to PDF or PNG Microservice — API for developers that enables you to generate beautiful documents and store them directly in your own S3 bucket.
Doppio.sh sponsor
nve 16.1: Run Things With a Specific Node.js Version — Execute a file, command, or REPL using a specific version (or multiple versions) of Node. For example, you could run npm test over multiple versions at once. v16.1 lets you specify a Node version stored in a package.json, .nvmrc, or similar file.
ehmicky
modbus-serial: Pure JS MODBUS-RTU Implementation — Modbus is a standard communications protocol used by industrial devices, in robotics, irrigation controllers, etc. and works over serial connections or TCP.
Yaacov Zamir
📰 Classifieds
🤔 JWTs are low-latency and offer better interoperability than session cookies for authentication, but they can also be less secure. Learn more about the tradeoffs on the Stytch blog.
💻 Hired makes job hunting easy-instead of chasing recruiters, companies approach you with salary details up front. Create a free profile now.
📅 TS Congress is an online TypeScript event taking place this September 21-22. There’s already a fantastic (and growing) line-up of speakers.
Classifieds is a new way to share projects, events or services you may find useful, with a mix of free and paid options.
More details to follow.
BullMQ 4.5: Reliable, Redis-Based Distributed Queue for Node — A fast, reliable Redis-based distributed queue for Node with a focus on stability and atomicity.
Taskforce․sh Inc.
Knex.js 2.5: A Query Builder for Multiple Databases — Knex is a popular ‘batteries included’ SQL query builder that supports Postgres, MySQL, SQL Server, SQLite3, and other SQL databases. v2.5 adds mostly small bits and pieces including a helper for using UUIDs in schemas.
knex
Kanel: Generate TypeScript Types from Postgres — It works by inspecting a live database and outputs code you can add to a TypeScript project and use with something like Knex (above) – GitHub repo.
Kristian Dupont
Psst.. if you’re a Postgres user, check out our weekly Postgres newsletter as well 😉
Octokit.js 3.0
↳ Official GitHub SDK for browsers, Node, and Deno.
Fastify 4.20
↳ The fast, low overhead web framework.
HyperExpress 6.8
↳ High-perf HTTP / WebSocket server.
Nest 10.1
↳ Popular server-side framework.
Mercurius 13.1
↳ GraphQL adapter for Fastify.