title: Intended way to run commands installed as dependencies
body: <p>I'm working on a Django project using <a href="https://github.com/jazzband/django-pipeline" rel="nofollow">Django Pipline</a> to process CSS and JavaScript files when deploying the static files of the application. I would like to use <a href="https://babeljs.io" rel="nofollow">Babel</a> to compile JSX source to JavaScript in that process. For this I will need to write a pipeline plugin which calls <code>babel</code> and passes it the JSX file.</p>
  
  <p>To install Babel and its dependencies, I've set up a minimal <code>package.json</code>:</p>
  
  <pre><code>{
      "name": "my-project",
      "version": "1.0.0",
      "description": "",
      "dependencies": [
          "babel-cli@6.11.4",
          "babel-preset-react@6.11.1"
      ]
  }
  </code></pre>
  
  <p>When I run <code>npm install</code> it will install all the necessary dependencies into <code>node_modules</code>.</p>
  
  <p>This all works fine but there is one part which eludes me. I have not found a straightforward way to run the <code>babel</code> binary. <code>npm</code> installs those binaries under <code>node_modules/.bin</code>, which is also returned by <code>npm bin</code>:</p>
  
  <pre><code>$ find node_modules -name babel
  node_modules/.bin/babel
  node_modules/babel-cli/lib/babel
  
  $ npm bin
  [...]/node_modules/.bin
  </code></pre>
  
  <p>What is the intended way to then e.g. run the <code>babel</code> binary?</p>
  
  <p>Should I put that directory on my <code>$PATH</code>? Is there a script akin to the <code>activate</code> script from <a href="https://pypi.python.org/pypi/virtualenv" rel="nofollow">virtualenv</a>? Should I hard-code the path in my project instead?</p>
  
  <p>I'm sure the authors of npm have thought of that use case. Otherwise projects like Babel would live in a gray area of intended usages of npm.</p>