utilities for working with vsix files
[!NOTE] If you are looking for a way to create vsix files programmatically, you can use the vsix-builder package, or if you just want to build with a CLI, you can use vsix-pack. This is just the building blocks, that powers vsix-builder and vsix-pack.
npm install vsix-utils
import { readVsix, writeVsix } from "vsix-utils";
const success = await writeVsix({
packagePath: "path/to/vsix",
force: true, // will overwrite the file if it exists
epoch: 1000000, // by using epoch it will always generate the same vsix file, if the files hasn't changed.
files: [
{
type: "local",
localPath: "path/to/file.txt",
path: "file.txt"
},
{
type: "in-memory",
contents: "file contents", // or use a buffer
path: "file.txt"
}
],
});
if (success) {
const vsix = await readVsix({
packagePath: "path/to/vsix"
});
console.log(vsix);
}
Published under MIT License.