Created
June 21, 2011 13:48
-
-
Save indutny/1037884 to your computer and use it in GitHub Desktop.
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
// Подключение модуля fs | |
var fs = require('fs'); | |
// Вызов асинхронного метода writeFile | |
fs.writeFile('/tmp/1.txt', 'A poem', function(err) { | |
// Все готово, можно сделать что-нибудь с файлом | |
// Например, удалить его | |
fs.unlink('/tmp/1.txt', function(err) { | |
// Ну вот, теперь как-будто ничего и не делали | |
}); | |
}); | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment