Technology

Dust your views

In our node js application, we can use variety of templating engines like "jade" , "ejs", "mustache" etc. Dust.js is an asynchronous templating engine which can be used both on server side as well as client side and provide easy caching with high performance. In my previous blog on EJS as a templating engine, i have mentioned how we...

by Sakshi Tyagi
Tag: node.js
11-Mar-2014

Node.js

Validation with Mongoose

In one of our Node.js projects, we used Mongoose module to interact with MongoDB. Mongoose provides us four types of built-in validation on schema as below: 1. Required: We can mark a field as required, which must be provided. 2. Limit: If field is type of Number in Schema, then we can restrict maximum and minimum value for that...

by Amit Kumar
Tag: node.js
19-Feb-2014

Node.js

Getting Started with Grunt:Task Runner

I was working on one of my projects which involved multiple task execution on regular basis. Well, I think that many of us have faced similar issues on their projects which increases our work and making it more time-consuming and increased work. Working in a community where people are actively developing tools to automate tedious...

by Sahil Chitkara
Tag: node.js
06-Feb-2014

Technology

Using EJS in your Node.JS application

EJS as the name implies embedded JavaScript, is a JavaScript templating library used to render html code along with JSON data in an easy and clean way. In a Node.JS application(here we are using an express application), you need to set the value of 'view engine' parameter to 'ejs'. [js] var app = express(); app.set('view engine',...

by Sakshi Tyagi
Tag: node.js
31-Jan-2014

Node.js

Writable Streams In Node.Js

In my previous blog we discussed about “Readable Streams in Node.js”. Here we will be learning about the next part of stream which is, writable stream. Writable stream is used to write data to a specific destination. Basically its has two main method : write. end Write: ...

by Sahil Chitkara
Tag: node.js
30-Jan-2014

Node.js

Streams in node.js : Readable and Writable

Within Node.js development, streams are used to transfer data including requests to an HTTP server, opening a file, stdin, stdout, stderr etc. Streams can be readable, writable or both. We can connect the readable stream to a writable stream using the pipe method. All streams are instances of event emitters in node.js. We can get...

by Sahil Chitkara
Tag: node.js
27-Jan-2014

Technology

Sandboxing In Node.JS Using VM Module

Two commonly known ways to execute a script in Node.JS are using eval () function or running it using VM module. Lets see this through an example: [js] var vm = require('vm'); this.name = "Sakshi"; var script = "this.name = 'Tyagi'", withVM, withEVAL; withEVAL = eval(script); console.log("withEVAL...

by Sakshi Tyagi
Tag: node.js
24-Jan-2014

Technology

Digging Into Event Emitters In Node.JS

In extension to my previous blog on Event Emitters Event Emitters In Node.JS, here we will see some variations in implementing Event Emitters. We can bind more than one listeners to an event. For example: [js] var events = require('events'); var eventEmitter = new events.EventEmitter(); var printFruit = function printFruit() { ...

by Sakshi Tyagi
Tag: node.js
23-Jan-2014

Technology

Event Emitters In Node.JS

Event Emitters are used to create and manage our own events and trigger them accordingly. We can bind listeners and emit those events whenever required. Example : [js] var events = require('events'); var eventEmitter = new events.EventEmitter(); eventEmitter.on('Morning', function welcomeMessage() { console.log('Good...

by Sakshi Tyagi
Tag: node.js
03-Jan-2014

Node.js

Node KnockOut at IntelliGrape : A 48 hours non-stop programming event

IntelliGrape has just completed its participation in Node KnockOut, Biggest Node JS programming competition. The event is described as 48 hours Hackathon featuring Node.JS where more than 400 teams/individuals across the globe participated with the motive to start an app from scratch and submit their final version of app as the time...

by Bansi
Tag: node.js
11-Nov-2013

Technology

ExpressJS: Route Parameter Pre-conditioning

Express JS is a very flexible yet powerful framework on top of exponentially growing Node JS Environment. Express makes it really easy to handle requests and how the server interacts with the outside world. It is very simple to get going and it has immense amounts of extremely useful features, Middleware is one of those features of...

by Manoj Nama
Tag: node.js
08-Sep-2013

AngularJS, Front End Development

Creating DOUGHNUT Pie Chart with Google Chart API & using it with Angular.js Directive

Showing data in the form of Graphical/Pictorial Representation is always a better way to present data than simple text. Users find data represented in pictorial manner more interactive and easy to understand than data in complex tables or lists. Cases where Pictorial data representation (Charts or Graphs) can be more user friendly: ...

by ajey
Tag: node.js
05-Sep-2013