Node and node package manager (npm) are to be installed before using koa framework. Node setup and npm can be installed with the commands:
The output produced is as:
The version of the node should be always above 6.5.0
Npm can be used in two ways to install a package – Globally and Locally
Globally – Facilitates in installing CLI based packages and development tools. A package can be installed globally by the code:
Locally – Facilitates in installing libraries and frameworks. Locally installed package enables to use only within the directory in which installed. A package can be installed locally by the code:
A package file package.json file need to be provided to create a project using npm. Packae.json provides complete information about the project, and can be set up easily by npm. To set up a development project:
1.A new folder with the name hello-world need to created and cd the terminal/cmd into the hello-world folder.
2.Package.json file is created using npm by following code:
Provide the name under “Author Name” field.
3.Package.json file is set up. Koa can now be installed and added to package.json file by the command:
Run the following code to check and confirm the installation of Koa.
A tool nodemon can be installed from npm, which enabled development process much easier. nodemon facilitates in restarting the sever whenever a change is made to any of the files automatically, avoiding the manual restart. Nodemon is installed by the command:
Koa.js Related Interview Questions
|Angular JS Interview Questions||Ext JS Interview Questions|
|Node.js Interview Questions||ReactJS Interview Questions|
|Backbone.js Interview Questions||D3.js Interview Questions|
|KnockoutJS Interview Questions||ExpressJS Interview Questions|
|Require Js Interview Questions||Vue.js Interview Questions|
|Polymer.js Interview Questions|
All rights reserved © 2018 Wisdom IT Services India Pvt. Ltd
Wisdomjobs.com is one of the best job search sites in India.