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

@maur025/core-commands

v1.0.1

Published

utility library to declare and extend the command pattern in Typescript.

Readme

Overview

Utility library to declare and extend Command Pattern, inspired by the java implementation.

Installation

Use the following command to install:

Using pnpm:

pnpm add @maur025/core-commands

Using npm:

npm install @maur025/core-commands

Using yarn:

yarn add @maur025/core-commands

Usage

Using thi library is simple. Extend AbstractCommand class to create a command. Override the run method(required) and optionally validate for custom validations.


Example

Command (example.cmd.ts)

import { AbstractCommand } from "@maur025/core-commands";

export default class ExampleCmd extends AbstractCommand<Request, void> {
	protected validate(request: Request): void {
		console.log("VALIDATING...");
	}

	protected run(request: Request): void {
		console.log("EXECUTING EXAMPLE...");
	}
}

interface Request {
	paramOne: string;
	paramTwo: number;
	paramN: string;
}

Your can assign any value to the input and output. These can be declarated as interfaces, classes, or primitive types.


Usage in your code (example.controller.ts)

import ExampleCmd from "src/command/example.cmd.ts";

const exampleCmd = new ExampleCmd();

export default class ExampleController {
	processData = (): void => {
		exampleCmd
			.withRequest({
				paramOne: "example",
				paramTwo: 2,
				paramN: "any value",
			})
			.execute();
	};
}

Suggestions

To improve code maintainability and reduce verbosity, consider using a Dependency Injection (DI) container to handle command instantation.

For example:

  • This avoids manually using new ExampleCmd() in your classes.
  • Promote better separation and makes testing easier.