Why use 'lib' vs 'src' directory names in JavaScript? Which is 'standard'?

Interesting question, but it seems to me that some developers just take it by their own worldview.

It also depends on the project:

Some projects are built with smaller components, which are just little pieces of the main functionality: lib.

lib/independent-pieces.js

Other projects are monolithic, the components depend on each other: src.

src/this-is-all-for-this-project-and-depend-on-each-other.js

For third-party libraries, it's common to use vendor.

vendor/bootstrap/
vendor/d3/

  • /node_modules - for 3rd party libraries.
  • /lib or /vendor- suggested putting your libraries which is not required for compilation.
  • /src - for your code source