repl.it
@Vandesm14/

Module Test

Nodejs

No description

fork
loading
Files
  • index.js
  • file.txt
  • moduleA.js
  • moduleB.js
index.js
1
2
3
4
5
6
7
8
const fs = require('fs');

var message = 'Hello World'; // Main Variable
var moduleA = require('./moduleA.js'); // console.log module
var moduleB = require('./moduleB.js'); // fs.read module

moduleA(); // Should log "Hello World" to the console
moduleA(); // Should log "This is a file" to the console
?