Created
October 27, 2010 12:17
-
-
Save Gozala/648918 to your computer and use it in GitHub Desktop.
Examples of using promised-fs
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
var Promised = require('promised-utils').Promised | |
, fs = require('promised-fs') | |
var lines = Promised(function lines(data) { | |
return data.split('\n') | |
}) | |
var data = fs.read('./README.md') | |
var myLines = lines(data) |
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
var fs = require('promised-fs') | |
var data = fs.read('./README.md') | |
fs.write('./whatever', data) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment