ajout de Sheebr + support de shutdown + auto install kernel

This commit is contained in:
Marc
2021-11-27 13:51:55 +01:00
parent a40aa1c153
commit 7480c8efc8
30 changed files with 1743 additions and 45 deletions
+27
View File
@@ -0,0 +1,27 @@
//@ts-check
/**
*
* @param {string} str
* @returns
*/
async function input(str) {
console.log(str)
process.stdin.resume();
process.stdin.setEncoding('utf8');
let line = "";
return new Promise((res, rej) => {
process.stdin.on('data', function(chunk) {
line += chunk
if (chunk.toString('utf-8').endsWith('\n')) {
process.stdin.pause()
res(line.substring(0, line.length -1))
}
});
process.stdin.on('error', function(err) {
rej(err)
})
})
}
module.exports = input