Introduction to the Nodejs native module

Source: Internet
Author: User

I. Express FRAMEWORK

As already described in the previous sections, you can use NPM to install the node. JS module. For more details, please refer to the previously written Nodejs introduction.

Express is a Nodejs Web-open source framework for building Web projects quickly. The main integration of the Web's HTTP server creation, static text management, server URL address request processing, get and POST request processing distribution, session processing and other functions.

Using the method, open the path to the Web project you want to create in CMD. And then enter

Express AppName

You can create a Web project named appname. Console Print Results

Enter appname folder input in cmd

Node Appname.js

Return results such as to indicate successful installation!

Such problems often arise in the development of a project

This error indicates that the relevant module is not installed and the workaround is to open the project folder on CMD and enter

NPM Install Express

After successful installation, a node_modules is generated under this file path, which contains the express framework code.

Other modules can also be installed in a similar way, and the installation path is also under Node_modules.

Second, Jade module

Jade is a high-performance, simple-to-understand template engine. You can write HTML files by using Jade.

Jade resembles a language for writing HTML quickly, with the following file suffix. Jade.

The following is the contents of the file

In the cmd input, the compressed can be by adding-p to do not compress, if each change the template to hit the command line a very troublesome is not, we can add Jade-p-W jade.jade plus a-w to open the monitoring mode, each time you change the template, the HTML file will be automatically compiled

The resulting HTML file is as follows:

Introduction to the Nodejs native module

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.