code: function write(myLocale) {
      try {
          stats = fs.lstatSync(directory);
      } catch(e) {
          fs.mkdirSync(directory, 0755);
      }
      fs.writeFile(locate(myLocale), JSON.stringify(locales[myLocale], null, "\t"));
  }
docs: try writing a file in a created directory