logger.js
file exports
log()
function. Content of the
logger.js
file:
function log(message) {
  console.log(message)
}

module.exports = log
The
log()
function is called in the
index.js
file:
const log = require('./logger')

log('some text')
by Valeri Tandilashvili
2 years ago
Node
Node.js Tutorial for Beginners - 1 Hour
0
Pro tip: use ```triple backticks around text``` to write in code fences