How to use the mime.stat function in mime

To help you get started, we’ve selected a few mime examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github zcbenz / nw-sample-apps / file-explorer / node_modules / folder_view.js View on Github external
fs.readdir(dir, function(error, files) {
    if (error) {
      console.log(error);
      window.alert(error);
      return;
    }

    for (var i = 0; i < files.length; ++i) {
      files[i] = mime.stat(path.join(dir, files[i]));
    }

    self.element.html(gen_files_view({ files: files }));
  });
}
github zcbenz / nw-sample-apps / file-explorer / node_modules / folder_view.js View on Github external
this.element.delegate('.file', 'dblclick', function() {
    var file_path = $(this).attr('data-path');
    self.emit('navigate', file_path, mime.stat(file_path));
  });
}