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

onion-initializr

v0.0.25

Published

Generate Onion Architecture folder structure, files, and code for TypeScript projects

Readme

Onion Initialzr for Frontend

Generate an Onion Architecture structure with entities, services, and even a frontend framework — all from a simple CLI. Alternativly you can use the Website


Features

  • Onion Architecture folder structure
  • Entity and service generators
  • Repository interface and implementation scaffolding
  • Prettier + ESLint auto-config
  • Frontend setup with Lit, React, Angular, Vue, or Vanilla
  • Dependency injection via Awilix or Angular for Angular-Frontend
  • Scan current project and generate Overview like on the website
  • Upload your own project file & validate

Website

Generator Website

Install locally

npm install onion-initializr -g

Usage

Run via CLI prompts:

onion

You’ll be asked for all relevant inputs: entities, services, dependencies, and UI framework.

Or run via JSON config:

onion --config myConfig.json

Run the command in the same directory as your myConfig.json, or provide an absolute path.


Example myConfig.json

When defining services, you must include an empty dependency array if there are no dependencies (e.g., "UserService": []).

{
  "folderPath": "./react-app",
  "entities": ["User", "Order", "Product"],
  "domainServices": [
    "UserService",
    "OrderService",
    "ProductService",
    "PaymentService"
  ],
  "applicationServices": ["UserAppService"],
  "domainServiceConnections": {
    "OrderService": ["Order", "User"],
    "UserService": []
  },
  "applicationServiceDependencies": {
    "UserAppService": {
      "domainServices": ["UserService"],
      "repositories": ["IUserRepository"]
    }
  },
  "uiFramework": "react",
  "_chooseFromThese": ["react", "angular", "vue", "lit", "vanilla"]
}

Note: You can also put the absolute Path (e.g. "/Users/YOURNAME/Desktop/generatedOnions/react-app").


Which frameworks are supported?

Use uiFramework in your config.

  • Lit (Vite + TypeScript)
  • React (Vite + TypeScript)
  • Vue (Vite + TypeScript)
  • Angular (Angular CLI)
  • vanilla

Which DI-Frameworks are supported?

Use diFramework in your config. If uiFramework is Angular, you can select Angular as your DI-Framework.

  • Awilix
  • Angular

Which UI-Libraries are supported?

When using uiFramework React, you can set uiLibrary to shadcn in your config.

-ShadCN

Output Structure

The generator creates a layered folder structure like this:

|-- src
|   |-- application
|   |   |-- services/
|   |-- domain
|   |   |-- entities/
|   |   |-- services/
|   |-- infrastructure
|   |   |-- config/
|   |   |   |-- awilix.config.ts
|   |   |-- interfaces/
|   |   |-- presentation/
|   |   |-- repository/
|-- package.json

Scan

You can also add Entities, Domain Services and Application Services in your Code Editor and later generate JSON Config.

onion --scan .\react\ reactConfig.json

The first Parameter ".\react" references the project, the JSON should be generated for. The second Parameter "reactConfig.json" is the Name of the JSON File.

The Scan works well when: The project was generated by this CLI Folder names match: Domain, Application, Infrastructure Entities, services, and repositories are not renamed Frontend is located under Infrastructure/Presentation AppService constructor uses 'private readonly' injection

Development

After making changes and want to work on the CLI, run:

npm run link

When you work with WebApp, run

npm run dev