2

Is there a way to create local folder in JavaScript using MeteorJS?

PS: App is hosted on Ubuntu server.

Cœur
  • 37,241
  • 25
  • 195
  • 267
eomeroff
  • 9,599
  • 30
  • 97
  • 138

1 Answers1

2

Use the meteorhacks:npm library to import the Node.js library fs, then you can do all sorts of file manipulation. Add fs to your packages.json file, then you can do:

var fs = Meteor.npmRequire('fs');
fs.mkdirSync(YOUR_PATH_STRING);

There's also an async version, and I've heard mkdirp is also popular as a node package.

Hope that helps!

Stephen Woods
  • 4,049
  • 1
  • 16
  • 27