JS Fundamentals in node
Export data in other file:-
[Link]:-
const data = require('./[Link]')
[Link](data.z());
[Link]:-
[Link] = {
x: 10,
y: 50,
z: function () {
return 10;
}
}
Core Module
The basic feature in any programming language is called Core
Module.
Example:-
[Link]
File System
HTTP
Buffer
Globle Module:-
Modules that do not need to be imported.
Example:-
[Link]
Non-Globle Module:-
Modules that do need to be imported.
Example:-
Express Js
File System
MongoDB
File create and Write:-
const fs = require('fs');
[Link]('[Link]', 'This is a Apple File.......');
Path find:-
const path = require('path');
[Link](__dirname);