0

I've just installed NodeJS version 14.16.1. After that I installed Visual Studio Code and created new NodeJS files to test how module exporting works.

I read in a tutorial that exporting works this way:

One file exports, for example this way:

Module.exports = 'Hello world';

Other file imports, for example this way:

    var msg = require('./Messages.js');

    console.log(msg);

So I tried this on my own and my VS Code does not have "Module" object available nor the "require" function. IntelliSense does not give me the option to choose any of these two basic features, which leaves me wondering what the heck is going on. Has NodeJS been updated and now uses different functions and objects? Or am I missing something plain simple?

DevelBase2
  • 139
  • 6

0 Answers0