Vote count:
0
I have a small script that uses npm pack to package a certain nodejs module. When I unpack the .tgz created by the npm pack command the directory inside is named package. My question is if there's a way to rename this package to the acutal name of the project?
Here's to code I'm using, might be helpful.
npm.load('./some/path', function (er) {
if (er) {
res.send("er");
}
npm.commands.pack(['./another/path'], function (er, data) {
if (er) {
res.send("error");
}
var fileName = __dirname+"/projectName-0.0.2.tgz";
res.sendFile(fileName, {
headers: {
"Content-Type": "application/x-tar"
}
});
});
asked 27 secs ago
NPM Pack: Rename package directory
Aucun commentaire:
Enregistrer un commentaire