mirror of
https://github.com/thangisme/notes.git
synced 2025-09-24 12:54:00 -04:00
Initial commit
This commit is contained in:
20
node_modules/write-file-stdout/index.js
generated
vendored
Normal file
20
node_modules/write-file-stdout/index.js
generated
vendored
Normal file
@@ -0,0 +1,20 @@
|
||||
var fs = require('fs');
|
||||
|
||||
/**
|
||||
* Expose `write`.
|
||||
*/
|
||||
|
||||
module.exports = write;
|
||||
|
||||
/**
|
||||
* Write `contents` to a `file`, falling back to stdout.
|
||||
*
|
||||
* @param {String} file
|
||||
* @param {String} contents
|
||||
*/
|
||||
|
||||
function write (file, contents) {
|
||||
if (1 == arguments.length) contents = file, file = null;
|
||||
if (file) return fs.writeFileSync(file, contents);
|
||||
process.stdout.write(contents);
|
||||
}
|
Reference in New Issue
Block a user