Node.js NPM

What is NPM? It is a package management tool for NODEJS

Official website: www.npmjs.com

There are now thousands of free package management tools available for free use

For example, if I want to install upper-case, I can enter the following in the command line

[php]npm install upper-case [/php]

Then in C:UsersMy Namenode_modulesupper-case
this module will appear

Using modules

[php]var uc = require(‘upper-case’);[/php]

Below is a node.js example

[php]

var http = require(‘http’);
var uc = require(‘upper-case’);
http.createServer(function (req, res) {
res.writeHead(200,
{‘Content-Type’: ‘text/html’});
res.write(<strong>uc(“Hello
World!”)</strong>);
res.end();
}).listen(8080);

[/php]

Then run the initialization

[php]

node node.js

[/php]

Leave a Comment

Your email address will not be published. Required fields are marked *

中文 EN
🚀

RedGate VPN

免费节点太挤太慢?
升级高速稳定专线

立即体验 →

告别卡顿

RedGate VPN
全球高速节点

免费下载 →
Scroll to Top