Manipulate JSON document easily with JMESPath

In my previous project I was struggling to filter a big JSON document to get my desired new array from it. In my struggle to simplify the filtration of JSON Object I have found JMESPath library. I find it really easy to understand and integrate. JMESPath is a query language for JSON. There is a GitHub page from where you can download the JMESPath.js file. To integrate it in website just add the .js file. Same way as any other

Continue Reading

Manage multiple Node.js versions using NVM

Recently in one of my project, I couldn’t run the npm install command successfully. After debugging for a while I came to know that I needed previous version of Node.js to install all the dependency successfully. NVM So I googled and came across the NVM tool which handles such situation. It allow us to install multiple version of the Node.js and maintains them. We can choose whichever version of the Node.js we want and go back to the default once

Continue Reading

Difference Between Promises & Callbacks

Promises are not Callbacks. A Promise is a value which may be available in future or not. A Callback is a function which we call inside other function. Normally callback runs after the parent function completes its operation. Let’s say the function is sending AJAX query, we can use callback function in a way so, when the AJAX request gets response, we can use the response in the function to do some other operation. In case you are interested to

Continue Reading

Accessible HTML5 Video Player w/ Closed Caption (CC)

HTML 5 Video w/Closed Caption Thumbnail

To have HTML5 Video on page is good and to have it with Closed Caption is even better, as it will make video accessible for physically challenged as well. This post is in continuation of my earlier post on HTML5 Video. In this post I have covered one of the most important feature of videos, Closed Caption. I received a comment in my earlier post to include the closed caption feature in the script to make it more helpful. Please refer

Continue Reading

Introduction to Javascript Promises API

Javascript Promises API

A Promise is a value not necessarily known at the time of it’s creation. It mainly used in asynchronous actions resulting in success or failure. The Promises represents a value which may be available now, or in the future, or never. Promises new Promise(function(resolve, reject) { }).then(function() { }).catch(function() { }); then() and catch() are prototype methods and they can ben chained as shown above. A Promise will always be either “Pending” or “Fulfilled” or “Rejected”. Pending – Initial state, operation not

Continue Reading