Skip to content

Commit fa60ae5

Browse files
committed
Initial commit
1 parent f49a83a commit fa60ae5

8 files changed

+32
-50
lines changed

Diff for: global-objects.js

-37
This file was deleted.

Diff for: exec.js renamed to nodejs-basics/exec.js

File renamed without changes.
File renamed without changes.

Diff for: nodejs-basics/global-objects.js

+32-10
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,37 @@
11
/**
2-
* Global Objects
2+
* ------------------
3+
* Global Objects
4+
* ------------------
35
*
4-
*/
6+
* __dirname()
7+
* __filename()
8+
* clearTimeout(timeoutObject)
9+
* console()
10+
* exports()
11+
* global()
12+
* module()
13+
* Process()
14+
* require()
15+
* setTimeout(callback, delay[, ...args])
16+
* TextDecoder()
17+
* TextEncoder()
18+
* URL()
19+
*
20+
* */
21+
22+
//----------------------
23+
// reqiure() Object
24+
//----------------------
25+
var path = require("path");
26+
console.log(`Rock on world from ${path.basename(__filename)}`); // Rock on world from global-objects.js
527

6-
// Displays current directory
7-
console.log(__dirname);
28+
const jsonData = require('./assets/file.json');
29+
console.log(jsonData);
830

9-
// Displays filename with path
10-
console.log(__filename);
11-
1231

13-
// Displays filename
14-
var path = require("path");
15-
console.log(path.basename(__filename));
32+
//-------------------------
33+
// dirname() & filename()
34+
//-------------------------
35+
console.log(`Current directory: ${__dirname}`);
36+
console.log(`Current directory: ${path.dirname(__filename)}`);
37+
console.log(`Current file: ${__filename}`);
File renamed without changes.
File renamed without changes.
File renamed without changes.

Diff for: package-lock.json

-3
This file was deleted.

0 commit comments

Comments
 (0)