318. The Node REPL
- REPL: Read-Eval-Print Loop
320 - 321.
global - The global namespace object
process - It provides information about, and control over, the current Node.js process.
process.argv - Returns an array containing the command-line arguments passed when the Node.js process was launched.
fs - It enables interacting with the file system in a way modeled on standard POSIX functions.
const fs = require('fs');
const folderName = process.argv[2] || 'Project';
console.dir(folderName);
fs.mkdirSync(folderName);
fs.writeFileSync(`${folderName}/index.html`, "");
fs.writeFileSync(`${folderName}/app.css`, "");
fs.writeFileSync(`${folderName}/app.js`, "");
'Web Development > Backend' 카테고리의 다른 글
32. Exploring Modules & The NPM Universe (0) | 2022.01.28 |
---|
댓글