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

@itrocks/crud-pack

v0.1.0

Published

The it.rocks default CRUD pack

Readme

npm version npm downloads GitHub issues discord

crud-pack

The it.rocks default CRUD pack.

Installation

npm i @itrocks/crud-pack

Adding this single dependency pulls in a coherent set of packages that implement the typical CRUD flows, with default implementations for the most common actions on your domain objects:

  • @itrocks/delete: Deletion action handling the button, user confirmation, data source deletion, and visual feedback,
  • @itrocks/edit: Generic action-based object edit form in HTML and JSON,
  • @itrocks/list: Generic action-based object list navigation in HTML and JSON,
  • @itrocks/new: Generic action-based new object form in HTML and JSON,
  • @itrocks/output: Generic action-based object output in HTML and JSON,
  • @itrocks/save: Persist object data, processing input from HTML or JSON sources,
  • @itrocks/summary: Generic action-based object summary in JSON.

@itrocks/crud-pack itself does not expose extra runtime APIs. It is primarily a convenience bundle that:

  • groups these packages under a single, versioned dependency,
  • provides a standard baseline for building CRUD screens and APIs.

Usage

You typically use @itrocks/crud-pack in applications or libraries defining CRUD actions and views for business objects.

Instead of depending on each CRUD package individually, simply install @itrocks/crud-pack and import the building blocks you need from their respective packages.

Typical use cases

  1. Use the default CRUD pack: If your app needs default CRUD actions, this pack provides them. It is the standard pack you can use in it.rocks applications, but you may replace it with any alternative CRUD implementation pack.
  2. Local override of default CRUD behaviour for a specific entity directly inside your package.
  3. Global override of default CRUD behaviour for all entities by inheriting and overriding components.

Examples

Example 1: Apply the default CRUD pack to your it.rocks application

Declare it as a dependency, and the it.rocks framework will automatically apply the default actions:

package.json

{
  "dependencies": {
    "@itrocks/crud-pack": "latest",
    "@itrocks/framework": "latest"
  }
}

Then, for this simple Movie entity:

app/movie.ts

import { Route } from '@itrocks/route'
import { Store } from '@itrocks/storage'

@Route('/movie')
@Store()
export class Movie
{
  title = ''
  year?: number
}

You then automatically get all default CRUD routes, actions, and views:

Output format depends on the Accept request header:

  • application/json → JSON response
  • text/html → HTML response

Example 2: Override CRUD for a simple Movie entity

package.json

{
  "dependencies": {
    "@itrocks/action-pack": "latest",
    "@itrocks/crud-pack": "latest"
  }
}

Define the exposed domain object:

app/movie.ts

import { Route } from '@itrocks/route'
import { Store } from '@itrocks/storage'

@Route('/movie')
@Store()
export class Movie
{
  title = ''
  year?: number
}

Override only the new action:

app/movie/new.ts

import { Request } from '@itrocks/action-request'
import { New }     from '@itrocks/new'
import { Movie }   from '../movie.js'

@Route('/movie/new')
export class NewMovie extends New<Movie>
{

  async getObject(request: Request<Movie>)
  {
    const newMovie = await super.getObject(request)
    if (newMovie.title === '') {
      newMovie.title = 'New movie ' + (Math.floor(Math.random() * 90000) + 10000)
    }  
    return newMovie
  }

}

Example 3: Override CRUD behaviour globally

To customise the default CRUD actions application-wide:

package.json

{
  "dependencies": {
    "@itrocks/crud-pack": "latest"
  }
}

Then override some default CRUD components using inheritance through @itrocks/compose.

app/custom-crud.ts

import { Request }             from '@itrocks/action-request'
import { Edit as DefaultEdit } from '@itrocks/edit'
import { New  as DefaultNew }  from '@itrocks/new'

export class Edit<T extends object = object> extends DefaultEdit<T>
{
  async html(request: Request<T>)
  {
    console.log('override all behaviour for edit action')
    return super.html(request)
  }
}

export class New<T extends object = object> extends DefaultNew<T>
{
  async html(request: Request<T>)
  {
    console.log('override all behaviour for new action')
    return super.html(request)
  }
}

Finally, apply this mapping in your configuration file:

config.yaml

compose:
  '@itrocks/edit': '/app/custom-crud:Edit'
  '@itrocks/new': '/app/custom-crud:New'