• Task manager for web project.
  • npm install -g gulp or npm install gulp –save-dev [for devDependencies, gulp is not needed for deployment]
  • Make gulpfile.js run gulp style, gives warning according to the code.
  • To inject js and css automatically:
    • npm install wiredep –save-dev #for bower dependencies
    • npm install gulp-inject –save-dev #for our dependencies
    • Code in gulpFile.js for injecting file.
    • in HTML files put
      <!– bower: js–>
      <!– endbower –>
    • for inject put
      <!– inject: js–>
      <!– endinject –>
    • run gulp inject and HTML files would have all js files required.
    • [See memo for css/less problem in bootstrap/gulp]

//These tools are used in gulpFile.js

JS Hint:

  • For coding standards => .jshintrc
  • Configurable and open source


  • For coding style => .jscsrc
  • Configurable and open source


use express.static to serve a folder, nodejs will check in this folder to render

  • app.get(“/text”, function(request, response){..});
  •“/text”, function(request, response){…});
  • var router = require(“express”).Router();
    .get(function(req, res){…});
    /text/ app will use router, for /text/text2/, router.route(“/text2”, …) can be used.
  • app.get(“/:id”)


  • A front-end package management tool.
  • Flat package hierarchy.
  • bower.json
  • npm install bower -g
  • bower init
  • bower install <packageName> –save
  • Make .bowerrc file, add “directory”: “<fullPathoftheFolder>”; bower install…

Nodejs, Express and NPM Introduction


Nodejs is an open-source, server-side, running environment.

  • Cross platform
  • Uses JS as language


Web developement framework for nodejs.


Node Package Manager.

  • Easy update and version management.
  • npm init => make package.json
  • npm install <package-name> –save => saves the package to package.json
    When saving a package to package.json there can be these string formats:
    “^4.x.x”  [Any release 4 major or minor version]
    “~4.13.x”  [Any minor version of 4.13]
    “4.13.2”  [Exact version]
    “*”  [Newest]
  • in  package.json, in scripts object write “start”: “node index.js”, in console write npm start. The start object would get run.