Created
August 12, 2019 19:24
-
-
Save ggondim/382ce2125b1666ccf6ccd80c1b538ed6 to your computer and use it in GitHub Desktop.
List vscode extensions with name, URL and description!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const path = require('path'); | |
const fs = require('fs'); | |
const defaultExtensionsPath = 'C:\\Users\\<YOURUSERFOLDERIFYOUUSEWINDOWS>\\.vscode\\extensions\\'; | |
const isDirectory = source => fs.lstatSync(source).isDirectory() | |
const getDirectories = source => | |
fs.readdirSync(source).map(name => path.join(source, name)).filter(isDirectory) | |
async function main() { | |
const extensions = getDirectories(defaultExtensionsPath); | |
const extensionsList = []; | |
for (let i = 0; i < extensions.length; i++) { | |
const extensionFolder = extensions[i]; | |
const extensionPackage = fs.readFileSync(path.join(extensionFolder, 'package.json'), 'utf8'); | |
const extensionJson = JSON.parse(extensionPackage); | |
extensionsList.push({ | |
id: extensionJson.name, | |
name: extensionJson.displayName, | |
url: extensionJson.homepage, | |
description: extensionJson.description, | |
}); | |
} | |
console.log(extensionsList); | |
} | |
main(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment