19 lines
533 B
JavaScript
19 lines
533 B
JavaScript
import readlineSync from "readline-sync";
|
|
import fs from "fs";
|
|
|
|
// Get user inputs
|
|
const orderNumber = readlineSync.question("Order Number: ");
|
|
const description = readlineSync.question("Description: ");
|
|
const location = readlineSync.question("Location: ");
|
|
// Create a config object
|
|
const config = {
|
|
orderNumber: orderNumber,
|
|
description: description,
|
|
location: location,
|
|
};
|
|
|
|
// Save to config.json
|
|
fs.writeFileSync("config.json", JSON.stringify(config, null, 2), "utf-8");
|
|
|
|
console.log("Configuration saved to config.json");
|