DASHA
This commit is contained in:
		
							
								
								
									
										13
									
								
								Работа с файлами/app.js
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								Работа с файлами/app.js
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,13 @@ | ||||
| const fs = require('fs'); | ||||
|  | ||||
| fs.appendFileSync('hello.txt', 'Привет ми ми ми!'); | ||||
|  | ||||
| fs.appendFile('hello.txt', 'Привет МИД!', function (error) { | ||||
|     if (error) throw error; // если возникла ошибка | ||||
|  | ||||
|     console.log( | ||||
|         'Запись файла завершена. Содержимое файла:' | ||||
|     ); | ||||
|     let data = fs.readFileSync('hello.txt', 'utf8'); | ||||
|     console.log(data); // выводим считанные данные | ||||
| }); | ||||
		Reference in New Issue
	
	Block a user
	 User1
					User1