Skip to content

Instantly share code, notes, and snippets.

@mwcz
Created May 4, 2012 02:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mwcz/2591352 to your computer and use it in GitHub Desktop.
Save mwcz/2591352 to your computer and use it in GitHub Desktop.
How to use Node's fs in Meteor
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"}
@windweller
Copy link

Yeah unfortunately "meteor_bootstrap" is not supported :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment