Join the social network of Tech Nerds, increase skill rank, get work, manage projects...
 

How to convert Csv file data to Json in Nodejs?

To convert CSV file data to JSON in NodeJs we will be using csvjson module package of npm for the conversion. npm is basically the package manager which provides the JavaScript runtime environment in the Node.js.   Installation: ...

How to Send Emails Using Nodemailer in Nodejs?

For sending emails using Nodejs we will be using The Nodemailer module. Nodemailer is a module that provides sending emails from the NodeJs application.   Here are some features of the Nodemailer module:   1) Zero Depende...

Update Node.js and npm to latest version in 4 Easy steps

  Node Package Manager or NPM is the default package manager for JavaScripts that offers offers two prominent functionalities:   Online storage facility for the node.js modules that are searchable on search.nodejs.org The ...

Node.js authentication with passport local

In node.js authentication and login could be a difficult task but there are some modules available in node that makes it easier for a node developer. One of them is Passport. Passport is a middleware that allows us to authenticate using username...

How to run a single mocha test?

When working in mocha, oftenly you don't want to run all the test cases. Mocha provides you the feature to specify which exactly you want to run. Running a single test file Using mocha-cli you can easily run a single. This can be accomp...

File Upload in Node.js

Form processing and file handling are very common and important part of any web application. Now with express, handling file uploads becomes very easy. So far we have seen and used req.body now we have req.files. req.files contains all the inform...

Hooks In Node.js

Hooks are used to add any functionality before or after our JavaScript methods like save, create etc. Using hooks we are able to write the code that can be run before or after save method. Suppose you have a User model, in that you have a pass...

Stub nodemailer send method using sinon in mocha node.js

Stub transport is useful for testing the email before actually sending email. It does not actually send an email, it convert mail object to a single buffer and return it with a send mail callback. In the below code, I have stubbed send method ...

How to add custom methods in checkit module?

Sometimes, you may have a long conditions to check for validity. In general, you may need to check certain thing that doesn't exists in checkit module, In that case you extends checkit module and add custom methods into it.   For e...

Using checkit module in nodejs

Checkit allows you to validate full javascript object, defining custom rules and message, I supports both asynchronous and synchronous validations. The validations by checkit works for both on browser and server.   Sample code: 1. A...

How to use sinon for stubing in mocha node.js?

Installation:   npm install sinon   It is simple and easy to use. You can easily fake any interface using sinon. Here, I am going to tell how to use sinon to make a stub of any ORM provided method in node.js. Sample co...

Node.js with Mongoose

Mongoose is similar to ORM( Object relational mapper) in many other languages. It is a node.js package that provides mongoDB object mapping. So basically mongoose converts the data in the database to the javascript objects that can be used in our...

Express-session in Node.js

For any web application session handling is very important part.Using sessions we can easily track user's activity throughout the application. If we are using express in our node application, setting up a session becomes very easy. Here we ...

Express validator

Express-validator is a node's middleware that can be used as form validation or we can say to validate the body, params, query, headers and cookies of request object. It has its own validation rule, and if any of the applied validation rule i...

Event loop in Node.js

In all the event driven programming, there is a main loop that listen's the events, and then invoke the corresponding callback function whenever one of those events occur. Here we might get confuse between events and callback, But the di...

How to scrap a website in node.js?

Sometimes, we may need to scrap data from a website (It could be any live website, For Ex: https://www.amazon.com).   There are 3 steps involved while scrapping a website:-   1- Getting the HTML content of a website's pa...

Callbacks in node.js

The basic idea behind using callback is that if we are doing a task and it is taking a longer time to complete. So instead of waiting for this task to be complete we want our node server to process other incomming request.In such situations we ca...

Express.js Middleware

Functions which can retrieve the request object, response object and the next middleware function in the application’s request-response cycle are Middleware. The concept behind middleware is same as Filters in other languages.   ...

Aynchronous Routing in ember js

It is not possible to have two db queries in model hook of ember js router. You can either create two router files- one for fetching the new records from database and the another one for fetching record. That is not a good approach to create...

How to create a custom helper in ember js, handlebar and ghost node.js

Sometimes, you may have repeated HTML on your handlebars template. In those cases, you can create and register a new helper, that can be invoked from hbs templeate. Gost: Ghost it a blogging platform developer on the top of express framework o...

How to use mocha for unit testing in node?

mocha is a javascript test framework. It works well for both node.js and browser. It makes asynchronous testing simple and easy. Mocha test run serially. mocha is open source. Installing mocha globally: npm install -g mocha With the ab...

Start project with npm init - Node.js

NPM's init command will scaffold out a valid json file for you project. The commands for npm init are:- mkdir myapis cd myapis npm init --yes I have used --yes option with the above command, because I don't want to set author...

Search records using angularJS with nodeJS

Welcome to Findnerd. Today we are going to build an application for searching the records. As we all know that we have written many blogs on angularJS as well as nodeJS. We want to recommend you to check these blogs for clear idea of these two fr...

Use of “npm start” command in nodejs

In this small tutorial we will learn how we use the “npm start” command in node.js.Let us create a simple node application using express framework: npm install -g express-generator express mynodeapp cd mynodeapp/ && ...

An Example of AngularJs with NodeJS

Welcome to FindNerd. Today we are going to take an example of angularJS scope variable with nodeJS. There are other blogs available related to angularJS as well as nodeJS. You can check these blogs to get a clear idea of these two javascript fram...

Configuring Ghost To Run On MySQL

By default Ghost uses sqlite3. But if you want to configure Ghost with MySQL Database, you can reconfigure the default settings in config.js file. Open config.js (<path-to-your-project>/config.js), replace the below lines of code: d...

Discussion on repl module in nodejs

Welcome to FindNerd. Today we are going to discuss repl module in nodejs. repl module deals in Real Eval Print Loop implementation that can work as standalone program or can be work with other applications. Nodejs includes repl as a core module. ...

Process for building the command-line tools for nodejs application

Welcome to FindNerd. Today we are going to discuss the process for building the command-line tools for your application. If you are reading our blogs on daily basis then you must have a good command on nodejs. We have explained different modules ...

Express application generator

As we know Express is the most commonly used web framework in node.It has many features such as rendering, routing and REST controls. But in this post we are going to discuss about express-generator. Express-generator is a application generator ...

Login process with passport module in nodejs

Welcome to FindNerd. Today we are going to point out the steps for login process in nodejs. In nodejs we use passport and passport-local modules for authentication. Passport works with express module. Passport process the request to authenticate ...

Node.js application directory structure

Node.js does not come with any predefined folder structure thus in order to architect your application it entirely depend on your nature of choice. Before architecting any application you should keep in mind the nature and scope of an application...

Authentication in NodeJS using Passport

Authentication is a mechanism of verifying users coming to particular system so that they can only make use of resources for which they have been provided permission. Having a strong authentication mechanism in an important part of a system. &...

Discussion on schemas in mongoose with nodejs

Welcome to FindNerd. Today we are going to discuss schemas in mongoose with nodejs. There are other blogs available on FindNerd which are describing different features of nodejs so you can read out these blogs as well. Question is raised that wha...

Using Webstorm For NodeJS

Webstorm is an IDE developed by JetBrains in order to help quick development with Javascript.  To start using Webstorm on linux machine we...

Discussion on GET request in nodejs

Welcome to FindNerd. Today we are going to discuss GET request in nodejs. There are different request methods available to process the data. Here we are going to take a small example on GET request in nodejs. First of all we want to mention that ...

node-sass css preprocessor for scss to css conversion

Sass stands for "Syntactically Awesome Style Sheets". It is compatible with all CSS versions available. If your CSS is getting complex, harder to maintain, here you can take the help of preprocessor.  Sass allows you to create v...

Events and emitters

Node.js comes with lots of core modules one of them is events module. We use EventEmitter in node js to create custom events and to react those custom events. It is something similiar as jQuery events:- element.on('click', function(msg) { ...

NodeJS and MongoDB

Node.js which make use of chrome v8 engine can be used for building fast, scalable network applications. It is based on event-driven and non-blocking I/O model thus making it lightweight and efficient and most suitable for real time application. ...

Discussion on custom modules in nodejs

Welcome to FindNerd. Today we are going to discuss custom modules in Nodejs. As we have discussed the in-build modules as well as other modules which are provided by npm. We can also create our own modules. Kindly use the following steps. &nbs...

What is callback hell?

Callback hell is the nesting of callbacks that is one callback inside another. Callback hell is very bad thing in nodejs, you should always avoid it.   To avoid callback hell you can: 1) Break callback into individual function 2)...

Discussion on jade/pug framework in nodejs

Welcome to FindNerd. Today we are going to discuss jade/pug framework in nodejs. Jade is framework for HTML templating in nodejs. Its maintainers have changed its name to pug due to trademark issue. Jade already registered name for other project....

Node Package Manager in Node.js

Node Package Manager (npm) stands for node package manager and it is a command line interface for installing Node.js packages,do version management and dependency management of Node.js packages. npm can be used to install packages in local or gl...

Discussion on MongoDB with Nodejs

Welcome to FindNerd. Today we are going to discuss mongoDB with nodejs. We use mongoDB with nodejs. MongoDB is nosql database. It is open source as well as cross-platform and well documented database. MongoDB uses collection which is set of mongo...

Restart Node.js server

While working on any node js application we have to restart node server every time we make any changes to the code. For a developer, it affects the productivity and is also irritating for some of us. To solve this problem we have a module in nod...

fs module in nodejs

Welcome to FindNerd, Today we are going to discuss an example of nodejs modules. We have already discussed the nodejs in-built modules in our previous blog. click here  to check the blog. We are going to take an example of fs module in no...

Simple chat application in node.js

Today, I am going to show you, how to create a simple chat application in node js using a special model "socket.io". It simply transmits messages from one client to all others. For this, I am going to create two files:- 1: main.js...

Discussion on in-build modules of Nodejs

Welcome to FindNerd. Today we are going to discuss in-build modules in nodejs. If you work in nodejs then you should be familiar with modules. There are many in-build modules available in core libraries of nodejs. You can also get the modules fro...

Calling function in another file Node

It is always good practice to break your code into smaller files which are more meaningful as per the actions being performed in them. Splitting files into smaller one will require us to have some way by which we can call each other as required a...

Authentication using JSON Web Token (jwt) in node.js

Authentication is one of the big part of any application. JSON web token is one of the safest medium of transferring information between two parties. The token is a long encryped string that has 3 parts-   The headers  - It contai...

Child Process(exec or spawn) In Node JS

As we all know that Node.js runs in a single thread mode and in order to achieve performance it make use of event-driven methodology. This event-driven methodology make Node.js efficient for I/O processes , but sometime there are cases where appl...
prev 1
Sign In
                           OR                           
                           OR                           
Register

Sign up using

                           OR                           
Forgot Password
Fill out the form below and instructions to reset your password will be emailed to you:
Reset Password
Fill out the form below and reset your password: