rangement/setup.mjs
2023-07-04 12:08:05 +02:00

38 lines
890 B
JavaScript

/**
création de la config
*/
import config from './configs.mjs'
import i18next from 'i18next'
let base_archive_folder = config.base_archive_folder
const { stdin, stdout } = process;
function prompt(question) {
return new Promise((resolve, reject) => {
stdin.resume();
stdout.write(question);
stdin.on('data', data => resolve(data.toString().trim()));
stdin.on('error', err => reject(err));
});
}
async function main() {
try {
const name = await prompt(i18next.t("home.title"))
// const age = await prompt("What's your age? ");
// const email = await prompt("What's your email address? ");
// const user = { name, age, email };
console.log(name);
stdin.pause();
} catch(error) {
console.log("There's an error!");
console.log(error);
}
process.exit();
}
main();