Don't cache packages on the filesystem

Should help with transient errors reported in #86, #104, and #110
This commit is contained in:
Michael Jackson
2018-07-04 16:30:11 -07:00
parent 700bb109a1
commit 5969ecc6ef
23 changed files with 570 additions and 702 deletions

View File

@ -0,0 +1,22 @@
const mime = require("mime");
mime.define({
"text/plain": [
"authors",
"changes",
"license",
"makefile",
"patents",
"readme",
"ts",
"flow"
]
});
const textFiles = /\/?(\.[a-z]*rc|\.git[a-z]*|\.[a-z]*ignore|\.lock)$/i;
function getContentType(file) {
return textFiles.test(file) ? "text/plain" : mime.lookup(file);
}
module.exports = getContentType;