Peter Jonsson

VS Code Extension Zipper

10. Apr. 2020

I recently faced an issue where I wanted to download extensions for Visual Studio Code in a portable way. I solved this by creating a small application that fetches a list of extensions in bulk and packages them in a zip.

I have a demo up and running here.

There were a few requirements that I wanted to satisfy, mainly:

  • Extensions can be installed from a computer without Internet access.
  • Extensions can be downloaded in bulk.
  • Nothing is handled on the client.

I solved this by creating a small web API through Lumen. This API accepts a list of extensions on the format publisher.package@version, or publisher.package (the unique identifier) if the default version (i.e. the latest) should be used. Extensions are parsed and downloaded individually through the same API that the official extension marketplace uses. All downloaded extensions are then packaged in a zip on the server before being downloaded to the client.

I also created a small view for submitting a request to my API through a small Vue-based application, which uses Tailwind for content styling and is served by the same Lumen application/API. The view is very basic and only contains a textarea in which line-separated extensions can be specified. The input is split on newline before being transmitted to the API.

The entire project took about three hours to complete. Some improvements such as displaying form validation errors remain. I estimate that this may take about an hour.

All of my requirements are fulfilled, and the zip can easily be transfered to offline computers. The source code can be found here.