Skip to content

Instantly share code, notes, and snippets.

View HaiBV's full-sized avatar
🔥
Journeyman in craftsmanship

Harvey Bui HaiBV

🔥
Journeyman in craftsmanship
View GitHub Profile
@ericelliott
ericelliott / essential-javascript-links.md
Last active June 14, 2025 18:43
Essential JavaScript Links
@branneman
branneman / better-nodejs-require-paths.md
Last active October 9, 2025 17:55
Better local require() paths for Node.js

Better local require() paths for Node.js

Problem

When the directory structure of your Node.js application (not library!) has some depth, you end up with a lot of annoying relative paths in your require calls like:

const Article = require('../../../../app/models/article');

Those suck for maintenance and they're ugly.

Possible solutions