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 🙏

© 2024 – Pkg Stats / Ryan Hefner

generator-code

v1.11.4

Published

Yeoman generator for Visual Studio Code extensions.

Downloads

15,983

Readme

Yo Code - Extension and Customization Generator

npm Package NPM Downloads Build Status License: MIT

We have written a Yeoman generator to help get you started. We plan to add templates for most extension/customization types into this.

Install the Generator

Install Yeoman and the VS Code Extension generator:

npm install -g yo generator-code

Run Yo Code

The Yeoman generator will walk you through the steps required to create your customization or extension prompting for the required information.

To launch the generator simply type:

yo code

The command generator

Generator Output

These templates will:

  • Create a base folder structure
  • Template out a rough package.json
  • Import any assets required for your extension e.g. tmBundles or the VS Code Library
  • For Extensions: Set-up launch.json for running your extension and attaching to a process

Command line

Usage:
  yo code [<destination>] [options]

Argument (optional):
  The destination to create the extension in, absolute or relative to the current working
  directory. Use '.' for the current folder.
  If not provided, defaults to a folder in the current working directory with the extension
  display name.

Options:
  -h,   --help                  # Print the generator's options and usage
  -i,   --insiders              # Show the insiders options for the generator
  -q,   --quick                 # Quick mode, skip all optional prompts and use defaults
  -o,   --open                  # Open the generated extension in Visual Studio Code
  -O,   --openInInsiders        # Open the generated extension in Visual Studio Code Insiders
  -t,   --extensionType         # ts, js, colortheme, language, snippets, keymap...
        --extensionId           # Id of the extension
        --extensionDescription  # Description of the extension
        --pkgManager            # 'npm', 'yarn' or 'pnpm'
        --bundle                # 'webpack', 'esbuild'. Bundle the extension with webpack or esbuild
        --gitInit               # Initialize a git repo

Example usages:
  yo code                       # Create an extension in a folder with the extension's name.
  yo code . -O                  # Create an extension in current folder and open with code-insiders
  yo code Hello -t=ts -q        # Create an TypeScript extension in './Hello', skip prompts, use defaults.
  yo code --insiders            # Show the insiders options for the generator

Run Generator using Docker

If you don't want to install nodejs or any node packages, use this method to containerize the generator.

Go into your project directory.

cd <project directory>

Build the docker image from the docker file.

docker build -t vscode-generator-code .

Create a docker container with volumes.

docker run -it -v $(pwd):/usr/src/app vscode-generator-code

Local development

After making necessary changes, run npm link before running yo code to test the local version.

You can learn more about Yeoman generator development on its documentation website.

History

  • 1.0.0: Generates a VS Code extension for TypeScript 2.0.3
  • 0.10.x: Generates a VS Code extension for TypeScript 1.8.10

License

MIT