UNPKG

@sussudio/platform

Version:

Internal APIs for VS Code's service injection the base services.

16 lines (15 loc) 734 B
/*--------------------------------------------------------------------------------------------- * Copyright (c) Microsoft Corporation. All rights reserved. * Licensed under the MIT License. See License.txt in the project root for license information. *--------------------------------------------------------------------------------------------*/ import { buffer } from '@sussudio/base/node/zip.mjs'; import { localize } from 'vscode-nls.mjs'; export function getManifest(vsix) { return buffer(vsix, 'extension/package.json').then((buffer) => { try { return JSON.parse(buffer.toString('utf8')); } catch (err) { throw new Error(localize('invalidManifest', 'VSIX invalid: package.json is not a JSON file.')); } }); }