Today one colleague explained me how to create nodejs projects and I notice that in ./node_modules there is an invisible folder named .bin. I must said that I discovered this after adding to the project "bootcamp" and "bower" tools. What's .bin purpose? What is it created for?
The bin folder holds binary files, which are the actual executable code for your application or library. Each of these folders are further subdivided into Debug and Release folders, which simply correspond to the project's build configurations.
bin. A lot of packages have one or more executable files that they'd like to install into the PATH. npm makes this pretty easy (in fact, it uses this feature to install the "npm" executable.) To use this, supply a bin field in your package. json which is a map of command name to local file name.
The command npm bin lets you find out where the closest executables are: $ npm bin /tmp/node_modules/.bin. If your shell is bash then you can define the following command for running executables from that directory: function npm-do { (PATH=$(npm bin):$PATH; eval $@;) }
staging" means, those dependencies are getting downloaded so for the temporary basis it keeps all those dependencies under ". staging" folder. Once all gets downloaded properly then it will showcase them under node_modules only.
That is a folder where binaries (executables) from your node modules are located.
NPM site states:
Executables When in global mode, executables are linked into {prefix}/bin on Unix, or directly into {prefix} on Windows.
When in local mode, executables are linked into ./node_modules/.bin so that they can be made available to scripts run through npm. (For example, so that a test runner will be in the path when you run npm test.)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With