Question: There are many popular JavaScript libraries and applications on GitHub and some put their raw source code in a `/src` directory, and others in a `/lib` directory.

I'm leaning towards the developers having done this depending on which languages they were taught growing up. So I see a lot of JavaScript developers use `/lib` (who also normally end up putting their packaged JS into a `/bin` directory). Meanwhile I often observe that those who use `/src` output their packaged JS into a `/dist` folder instead.

**What is considered the standard pattern for JavaScript, `src` or `lib`.** Maybe there isn't a right or wrong answer at all.

Answer: 
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