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 […]

Sakshi Tyagi
Sakshi Tyagi
Read

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: writable.write(chunk,[encoding],[callback]) This method is used to write the […]

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 different […]

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 :" + withEVAL + ", " + "local […]

Sakshi Tyagi
Sakshi Tyagi
Read

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() { console.log(‘I like Mango!!’); } […]

Sakshi Tyagi
Sakshi Tyagi
Read

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 Morning!!’); }); eventEmitter.on(‘Evening’, function goodByeMessage() { console.log(‘Good Evening!!’); }); if(new Date().getHours() <= 12) […]

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 gets over. The competition […]

Bansi
Bansi
Read

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 […]

Manoj Nama
Manoj Nama
Read

AngularJSFront 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: 1. If you […]

ajey
ajey
Read