Created
May 4, 2012 02:08
-
-
Save mwcz/2591352 to your computer and use it in GitHub Desktop.
How to use Node's fs in Meteor
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
After installing meteor, I ran these commands | |
meteor create testapp | |
cd testapp | |
meteor | |
Then I modified the is_server block of testapp.js like so: | |
if (Meteor.is_server) { | |
Meteor.startup(function () { | |
var require = __meteor_bootstrap__.require; | |
var fs = require('fs'); | |
fs.stat( '.', function( err, stat ) { | |
console.log( JSON.stringify( stat ) ); | |
}); | |
}); | |
} | |
Expected output in the terminal is something like this: | |
{"dev":65026,"ino":4329400,"mode":16877,"nlink":3,"uid":1000,"gid":1000,"rdev":0,"size":4096,"blksize":4096,"blocks":8,"atime":"2012-05-04T02:06:10.000Z","mtime":"2012-05-04T02:06:10.000Z","ctime":"2012-05-04T02:06:10.000Z"} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Yeah unfortunately "meteor_bootstrap" is not supported :)