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 🙏

© 2025 – Pkg Stats / Ryan Hefner

swagen

v1.0.0-beta.55

Published

Client code generator for Swagger JSON

Readme

Swagen

Build Status Greenkeeper badge

Swagen is a pluggable command-line tool to generate code and documentation from Swagger definitions.

Getting Started

This section discusses installing the Swagen tool globally. See here for installing it locally in your project to avoid global dependencies.

# Install Swagen CLI
npm install -g swagen

# Install a generator
npm install -g swagen-angular

# Create configuration file
# This will ask you some questions and create a swagen.config.json file in the local directory.
swagen init

# Generate the code
swagen

Further reading

Command-line reference

Installing Swagen locally in your project

Generators

Swagen is a pluggable tool that uses generator plug-ins to perform the actual code generation. Each generator is a Node package following a naming convention of swagen-xxxx where xxxx is the name of the generator. Examples are swagen-angular or swagen-dotnet-httpclient. Having a concept of generator packages allows 3rd-parties to write their own generators and plug them into the tool.

Further reading

Writing a generator package

If you want to write a custom generator specific to your project, and not have to publish it, Swagen also support local generators.

Writing local generators

Configuration

Swagen uses configuration to specify how to generate files from one or more Swagger sources. The configuration file is called swagen.config.json and should be located in the same directory where the swagen command is run from.

You can create a configuration file by running the following command:

swagen init

This is an interactive command and ask you a series of questions before generating a swagen.config.json file in the current directory. In case a swagen.config.json file already exists in the current directory, it will add a new configuration to the existing file. A single swagen.config.json file can contain multiple configurations, each representing a separate Swagger source.

Further reading

Swagen configuration schema and general options

Advance configuration

Writing configuration in Typescript instead of JavaScript

Documentation

Swagen documentation can be found in the wiki.