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

mvp-schematic

v2.0.1

Published

A functional schematic for Angular CLI to generate MVP (Model-View-Presenter) structured components, supporting both classic (NgModule) and modern (standalone) Angular approaches.

Readme

MVP Schematic

A functional schematic for Angular CLI to generate MVP (Model-View-Presenter) structured components, supporting both classic (NgModule) and modern (standalone) Angular approaches.


Installation

Install the package in your Angular project:

npm install mvp-schematic

Setup

After installing, run the setup command to copy the interactive generator script and add the npm script to your project:

npx mvp-schematic postinstall

This will:

  • Create a scripts folder (if it doesn't exist).
  • Copy the generate-mvp.js interactive generator script into scripts/.
  • Add the generate:mvp script to your package.json.

Usage

Interactive Generator

Run the following command to launch the interactive MVP component generator:

npm run generate:mvp

You will be prompted for:

  • Component name: Must not contain spaces or special characters.
  • Target path: Where to generate the component (default: src/app/features).
  • Use Angular standalone style? If yes, the schematic will generate standalone components and routing using the latest Angular patterns.
  • Include presenter.ts file?
  • Include module.ts file? (only if not standalone)
  • Include routing.ts file?
  • Include .scss file?

The generator will then run the schematic with your selected options.


Direct Schematic Usage

You can also use the schematic directly with Angular CLI:

ng generate mvp-schematic:mvp --name=example --standalone=true --with-presenter=true --with-module=false --with-routing=true --with-styles=true --target-path='src/app/features'

Features

  • Supports both classic (NgModule) and standalone Angular component generation.
  • Modern routing: When using standalone, generates routes as export default [] as Routes;.
  • Presenter pattern: Optionally generate a presenter service for the MVP pattern.
  • Customizable: Choose whether to include styles, routing, presenter, and module files.
  • Version-aware: Automatically adapts to Angular versions where standalone is the default (Angular 19+).

Development & Local Testing

To test your schematic locally before publishing to npm:

  1. Build the schematic:

    npm run build
  2. Link the package globally:

    npm link
  3. In your Angular project, link the schematic:

    npm link mvp-schematic
  4. Run the generator as described above.

To unlink after testing:

npm unlink mvp-schematic

Publishing

  • Ensure the dist folder and all necessary files are included (see the files field in package.json).
  • Bump the version in package.json as needed.
  • Run:
    npm publish

Notes

  • The schematic detects your Angular version and omits the standalone: true property if your project uses Angular 17+ (where standalone is the default).
  • The interactive generator validates the component name to avoid spaces or special characters.
  • All templates are separated into classic and standalone folders for maintainability.

License

MIT