Ch-4 Node Package Manager
Ch-4 Node Package Manager
• Include the "upper-case" package the same way you include any other
module:
• var uc = require('upper-case');
Example
• var http = require('http');
var uc = require('upper-case');
http.createServer(function (req, res) {
res.writeHead(200,
{'Content-Type': 'text/html'});
res.write(uc.upperCase("Hello World!"));
res.end();
}).listen(8080);
Global vs Local Installation
"repository": {
<Define your URL here>
}
Here we need to define two elements:
• Type of source to which you are going to provide URL
• url
Repository
• We define these two elements in key-value pairs. Here key is element
name and value is either type of source or url.
E.g.
"repository": {
"type" : "git",
"url" : "https://github.com/bnb/metaverse.git"
}
Creating a package.json file: