NodeJS--CLi-Npx-card
Exercices BeCode Utilisation Node JS
J'ai utilisé ceci :
npm link
Type one and only one time this line of code at the top of your file to import the little library we installed earlier:
const readlineSync = require("readline-sync");
Then you can do this:
let userName = readlineSync.question('Can you give me your name please?');
console.log("Hello " + userName);
It's not frequently used in real-life programs but it will be useful for simple exercises.
Example
const { getCode, getName } = require('country-list');
console.log(getName('IS')); // Iceland
console.log(getCode('Iceland')); // IS
console.log(getCode('Nowhere-to-be-found-land')); // undefined