Man 1: Some node modules provide a command line utility that can be used from the shell. Mocha is one of the things that does that. The way that it does that is in Mocha's package.json it lists, in this case, two files. Generally there's just going to be one.
In this .bin identifier it lists out the files that it would like for MPM to make available from the command line. What MPM does in response is it creates this .bin folder within your node modules folder. It's regularly hidden from view. It then creates shortcuts to those files that were specified by Mocha.
What you can then do to run that directly from the shell is to simply use that path to the local node modules folder and then .bin and then the name of the file. In this case we're just going to ask for the version. You can see there that the locally installed version of Mocha is 1.18.2.
Now, a lot of tutorials and instructions that you'll see recommend to install things globally simply so that you can run them from the command line but that's actually entirely unnecessary. You can use the method that we just did to access the local path. You can use the scripts fields of your package.json which we'll cover later. Or the even easier way is to simply add that local path that we just used to your path environment variable.
If you were to set to run this command. I'm not going to because I already have it. But if you were to add the ./node_modules./bin to your local path you can then simply use this file directly. I can just say Mocha-version and it's going to be that locally installed version.
I can even say which Mocha and it will tell me that I'm point at that locally installed version.