This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const watcher = fs.watch(__dirname, function (event, filename) { | |
console.log('Event: ', event, ' ', 'filename: ', filename); | |
}); | |
watcher.on('error', function (err) { | |
console.log(err); | |
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
function getValue(flag) { | |
const index = process.argv.indexOf(flag); | |
if (index > -1) { | |
return process.argv[index + 1]; | |
} else { | |
return null; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
function getValue(flag) { | |
const index = process.argv.indexOf(flag); | |
if (index > -1) { | |
return process.argv[index + 1]; | |
} else { | |
return null; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ДЗ Ядро | |
/* | |
+++Задание 1 | |
Реализовать программу, которая принимает на вход один или более аргументов и выводит их | |
сумму в консоль(stdout) | |
*/ | |
/* | |
const stdout = process.stdout; | |
const argv = process.argv; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stdin = process.stdin; | |
const stdout = process.stdout; | |
const waitTimeout = 6000; | |
const waitInterval = 1000; | |
var currentTime = 0; | |
var percent = 0; | |
function print (percent) { | |
stdout.clearLine(); | |
stdout.cursorTo(0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stdin = process.stdin; | |
const stdout = process.stdout; | |
const waitTime = 6000; | |
var currentTime = 0; | |
var loadsec = (waitTime - 1000) / 1000; | |
stdout.write(`loading ${loadsec} seconds...\n`); | |
var tm = setInterval(function () { | |
stdout.write((currentTime += 1).toString() + '\n'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const stdin = process.stdin; | |
const stdout = process.stdout; | |
stdout.write('Enter you name -> '); | |
stdin.on('data', function (data) { | |
stdout.write('Your name is -> '); | |
var name = data.toString().trim(); | |
stdout.write(name + '\n'); | |
stdout.write('Your name to reverse -> ' + name.toString().split('').reverse().join('') + '\n'); |
NewerOlder