[Code] Hello World! NodeJS
References : https://nodejs.org/dist/latest-v16.x/docs/api/
Hello World.
index.js
const hello = 'Hello world';
console.log(hello);
Read File System.
const fs = require('fs');
const textIn = fs.readFileSync('./txt/motivation.txt', 'utf-8');
console.log(textIn);
Write File System.
const fs = require('fs');
const textIn = fs.readFileSync('./txt/motivation.txt', 'utf-8');
console.log(textIn);
const textOut = This is what I know about the motivation: ${textIn}.\nCreated on ${Date.now()};fs.writeFileSync('./txt/output.txt', textOut);console.log('Create new file');
![[Code] Synchronous vs. Asynchronous Code](https://cdn.hashnode.com/res/hashnode/image/upload/v1678375309732/736a881b-ae1d-44e1-a632-822c5066b65d.png)