npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

vscode-extensions-json-generator

v0.2.2

Published

Define `Config` interface, and add documentation with annotations for additional data for the configuration

Readme

VSCode-extensions package.json generator

Usage

In code

Define Config interface, and add documentation with annotations for additional data for the configuration

export interface Config {
  /**
   * @default true
   * @description description of boolConfig
   */
  boolConfig: boolean;

  /**
   * @enumDescriptions [
        "Foo description"
        "Bar description"]
   * @default "Bar"
   * @description enumConfig description
   */
  enumConfig: 'Foo' | 'Bar';
}

As cli tool

update-package-json ts2pjs 'vscode-extension-config.json'

The input JSON file may look like this:

{
  "prefix": "myExt",
  "configurations": [
    {
      "filePath": "./src/config.ts",
      "name": "Config"
    }
  ],
  "targetFile": "package.json",
  "tsconfig": "tsconfig.json"
}

As a Webpack plugin

const {
  VSCodeExtensionsPackageJsonGenerator,
} = require('vscode-extensions-json-generator/webpack');

{
  // ...
  plugins: [
    new VSCodeExtensionsPackageJsonGenerator('vscode-extension-config.json'),
  ];
}

or with object as the config

{
  // ...
  plugins: [
    new VSCodeExtensionsPackageJsonGenerator({
      prefix: 'myExt',
      configurations: [
        {
          filePath: './src/config.ts',
          name: 'Config',
        },
      ],
      targetFile: 'package.json',
      tsconfig: 'tsconfig.json',
    }),
  ];
}

Bonus - accessing configuration from code utility

import { configUtils } from 'vscode-extensions-json-generator/utils';

export const getConfiguration =
  configUtils.ConfigurationGetter<Config>('myExt');

// use it to get configuration with auto-complete and automatically type inference
const e = getConfiguration('enumConfig');

or as a class

import { configUtils } from 'vscode-extensions-json-generator/utils';

export const configurations = new configUtils.VSCodeConfigurations<Config>('myExt');

// get
const e = configurations.get('enumConfig');

// update
configurations.update('enumConfig', 'Foo');

Config options

{
  "configurations": [
    {
      "filePath": "./src/config1.json",
      "name": "Config1"
    },
    {
      "filePath": "./src/config2.json",
      "name": "Config2"
    }
    // ...
  ],
  "prefix": "myExt",
  // tags that aren't being used in json schema by default.
  "tags": [
    "markdownDescription",
    "scope",
    "patternErrorMessage",
    "deprecationMessage",
    "enumDescriptions",
    "deprecated"
    // ...
  ],
  "targetFile": "package.json",
  "tsconfig": "tsconfig.ts",
  "sort": true
}

Convert from existing package.json to TypeScript interface

Use the cli tool with pjs2ts.

update-package-json pjs2ts 'package.json' -p conf --add-config-class

Options:

Convert the package.json `contributes.configurations` to a TypeScript file     

Arguments:
  inputFile                   input package.json file (default: "package.json")

Options:
  -p, --prefix [prefix]       prefix for the configuration
  -o, --output [outputFile]   output file (default: "config.ts")
  --add-config-class
  --config-class-name [name]  name of the configuration class (default: "Configuration")
  -h, --help                  display help for command