While the following structure is not an absolute requirement or enforced by the tools, it is a recommendation based mostly 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.
src/
is for the code you write manually independent of the module formatlib/
is for modules compiled fromsrc/
into a format compatible with standardrequire
in the node versions indicated byengines
in yourpackage.json
(UMD, CommonJS)dist/
is for modules or scripts compiled fromsrc/
into formats not compatible with standardrequire
in the node versions indicated byengines
in yourpackage.json
(AMD, browser globals/IIFE)