Ugrás a fő tartalomra

NodeJs

NodeJs






Node Package Manager (NPM) // https://npmjs.org/  [package.json]

-- Modulok :

EE net: For creating TCP clients and servers
EE http: For creating and consuming HTTP services
EE fs: For accessing and manipulating files
EE dns: For using the DNS service
EE events: For creating event emitters
EE stream: For creating streams
EE os: For accessing some local operating system statistics
EE assert: For assertion testing
EE util: For miscellaneous utilities


-- Három fő modul tipus:

core modules, user modules, and third-party


-- core modulok használata importálása:

var fs = require('fs');



-- Saját modulok használata:

// simple_module.js file tartalma
module.exports = 'ABC';

// import.js file tartalma
var simpleModule = require('./simple_module.js');
console.log(simpleModule);

// script futatása
Node import.js



Megjegyzések