Can't write with fs



I’m trying to write with fs in a package I’m making. The code I have is this

fs = Npm.require('fs');

steamBot.on('sentry', function(data) {
	console.log('Got sentry')
	fs.writeFileSync('sentry', data);

I can see the console.log firing but there is no file to be found.

max@max:~/dev/steamtest$ find . -name sentry

How can I use this module in meteor?


The path you’re writing to will be relative to the compiled app code. You should change the path to be somewhere where you can find the file.


Any suggestions? Does Meteor have something like Meteor.rootPath()?


What kind of package are you writing that requires writing things in the file system? Is what you’re doing more suitable as a build plugin?


No, I’m just saving some data. I think it’s a binary file? Not sure. It’s used when authing to Steam.