title: npm as a build tool
body: <p>I recently read a great article outlining the downside of using Grunt/Gulp;
  which in turns offers leveraging the "npm scripts" approach.</p>
  
  <p>Eventually I found this article: <a href="http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/" rel="nofollow">http://blog.keithcirkel.co.uk/how-to-use-npm-as-a-build-tool/</a></p>
  
  <p>I took a shot and tried to implement the as described in the article,
  and came across a two questions:</p>
  
  <p>Question #1:</p>
  
  <pre><code>$ npm run build:js ( actual command is: "browserify src/javascript/someModule.js" )
  
  // ----------- Why these two lines are added to the stdout ? -------- //
  &gt; my-new-app@1.0.0 build:js /Users/elad.chen/Projects/incapsula/daedalus/new-app
  &gt; browserify src/javascript/core/sidebar.js
  // --------------------------------------------------------------------
  
  (function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&amp;&amp;require;if(!u&amp;&amp;a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&amp;&amp;require;for(var o=0;o&lt;r.length;o++)s(r[o]);return s})({1:[function(require,module,exports){
  module.exports = function() {
      console.log("hi")
  };
  },{}]},{},[1]);
  </code></pre>
  
  <p>I then realized that npm -s, --silent or even --loglevel flags 
  can resolve that.</p>
  
  <p>So, if I type "npm run build:js -s" in console, the stdout doesn't include
  the redundant logs, But, If I simply add one of the flags to the actual task value, e.g:</p>
  
  <blockquote>
    <p>"build:js": "browserify src/javascript/core/sidebar.js --silent"</p>
  </blockquote>
  
  <p>I still get that extra log info.</p>
  
  <p>Question #2:
  When I used Gulp I was able to add breakpoints and debug any running task with ease since I'm using Intellij Idea. </p>
  
  <p>How can I debug when using npm scripts as the build tool?</p>