There are a lot of details in the [File System API][1]. The most common way is:
```
const fs = require('fs');
fs.writeFile("/tmp/test", <buffer>, function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
```
[1]: http://nodejs.org/docs/latest/api/fs.html
There are a lot of details in the [File System API][1]. The most common way is:
<!-- language: lang-js -->
const fs = require('fs');
fs.writeFile("/tmp/test", "Hey there!", function(err) {
if(err) {
return console.log(err);
}
console.log("The file was saved!");
});
[1]: http://nodejs.org/docs/latest/api/fs.html