Skip to content

Instantly share code, notes, and snippets.

Peter Vu vietvu-nguyen

  • neukind
  • tokyo
Block or report user

Report or block vietvu-nguyen

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
vietvu-nguyen /
Created Jan 17, 2020 — forked from tracker1/
Anatomy of a JavaScript/Node project.

Directory structure for JavaScript/Node Projects

While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based on what the JavaScript and in particular Node community at large have been following by convention.

Beyond a suggested structure, no tooling recommendations, or sub-module structure is outlined here.


  • lib/ is intended for code that can run as-is
  • src/ is intended for code that needs to be manipulated before it can be used

Better local require() paths for Node.js


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

vietvu-nguyen / index.html
Created Feb 11, 2019
Simple CSS animation
View index.html
<div class="wrap">
<div class="container">
<div class="box1 box"></div>
<div class="container">
<div class="boxes">
<div class="box2H box"></div>
<div class="box2 box"></div>
You can’t perform that action at this time.