Add fetch* utils

This commit is contained in:
Michael Jackson
2018-05-21 15:44:00 -07:00
parent ba14f9197f
commit 26ba4698e3
7 changed files with 200 additions and 153 deletions

View File

@ -0,0 +1,9 @@
const path = require("path");
const tmpdir = require("os-tmpdir");
function createTempPath(name, version) {
const hyphenName = name.replace(/\//g, "-");
return path.join(tmpdir(), `unpkg-${hyphenName}-${version}`);
}
module.exports = createTempPath;