node js split

// Step 1: Include the 'fs' module
const fs = require('fs');

// Step 2: Read the content of a file synchronously
const fileContent = fs.readFileSync('example.txt', 'utf-8');

// Step 3: Split the content into an array using a delimiter (e.g., newline character)
const lines = fileContent.split('\n');

// Step 4: Output the resulting array
console.log(lines);