Where to store global binary data for a vscode extension

You might want to consider creating a file path defined in the User Settings; I think this solution covers all of your requirements.

You can set a default value in the package.json and it's transparent to the user - they can change it if they want to.

More info here: https://code.visualstudio.com/api/references/contribution-points#contributes.configuration


The January 2019 release of VS Code added ExtensionContext.globalStoragePath, which is a global version of storagePath

An absolute file path in which the extension can store global state. The directory might not exist on disk and creation is up to the extension. However, the parent directory is guaranteed to be existent.

https://code.visualstudio.com/updates/v1_31#_global-storage-path