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

@the-codegen-project/cli

v0.24.1

Published

CLI to work with code generation in any environment

Downloads

923

Readme

The Codegen Project banner

License Npm latest version NPM Downloads GitHub Actions Workflow Status GitHub last commit GitHub Downloads (specific asset, all releases) GitHub Downloads (specific asset, all releases) GitHub Downloads (specific asset, all releases) GitHub Downloads (specific asset, all releases) GitHub Downloads (specific asset, all releases) GitHub Downloads (specific asset, all releases) homebrew downloads Chocolatey Downloads All Contributors

Read the Docs | View Demos

Core Features

  • 📃 Generate payload representations from your AsyncAPI document (including Protobuf, RAML, OpenAPI Schema)
  • 📊 Customize the generators output to your hearts desire
  • 💫 Regenerate once the input changes
  • 👀 Integrate it into any project (such as Next.JS, etc.)
  • 💅 Create custom generators (read more)
  • 🗄️ Protocol agnostic generator (docs)
  • ⭐ And much more...

How it works

The Codegen Project is a generator that is built to live along side your projects to help you save time in the development phase, ensuring you spend as much time on the business logic as possible. It works by using your configuration file to know what it needs to generate.

Each input has different generates and all of them can be customized, or you can build your own generator right in the configuration file.

export default {
  inputType: 'asyncapi',
  inputPath: './asyncapi.json',
  language: 'typescript',
  generators: [
    {
      preset: 'payloads',
      outputPath: './src/payloads',
      serializationType: 'json', 
    },
    ...
  ]
};

In this example, the generator will read the AsyncAPI document located in same directory as the configuration file, and generate TypeScript models for all the payload including code to serialize the models to JSON.

Getting started

Its simple, install the CLI into your project or machine, setup the Codegen configuration file to include all the code your heart desire, customize it, and generate it at build time or whenever you feel like it.

Install

Installing the CLI can be done inside a project or within your system.

NPM

npm install --save-dev @the-codegen-project/cli

npm install -g @the-codegen-project/cli

Yarn

yarn add @the-codegen-project/cli

Pnpm

pnpm add @the-codegen-project/cli

Bun

bun add @the-codegen-project/cli

Download

curl -OL https://github.com/the-codegen-project/cli/releases/latest/download/codegen.x64.pkg

Install

sudo installer -pkg codegen.x64.pkg -target /

Download

curl -OL https://github.com/the-codegen-project/cli/releases/latest/download/codegen.arm64.pkg

Install

sudo installer -pkg codegen.arm64.pkg -target /

Download

curl -OL https://github.com/the-codegen-project/cli/releases/latest/download/codegen.deb

Install

sudo apt install ./codegen.deb

Download

curl -OL https://github.com/the-codegen-project/cli/releases/latest/download/codegen.tar.gz

Install

tar -xzf codegen.tar.gz

Symlink

ln -s <absolute-path>/bin/codegen /usr/local/bin/codegen

You can find all the possible commands in the usage documentation.

Initialize

Add a configuration file, either manually or through the CLI;

codegen init

Initialize The Codegen Project

Customize it to your heart's desire!

Generate

With your configuration file in hand, time to generate the code and use it! This can be done manually or integrate into your build process. Checkout all the examples for inspiration how to do it.

codegen generate

👀 Goals

Besides the milestones, we have certain goals that we want to reach for various reasons;

  • ⭐ Reach 50 stars - So we can publish the CLI on Brew and Chocolatey
  • 📃 3 Published resources (blog post, video, etc)

📃 Resources

People who have been so kind to write or talk about The Codegen Project;

  • Write one!

Contribution Guidelines

We have made quite a comprehensive contribution guide to give you a lending hand in how the project is structured and how to contribute to it.

Contributors

Thanks go out to these wonderful people (emoji key):

This project follows the all-contributors specification. Contributions of any kind are welcome!