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

@nest-util/nest-crud

v2.1.0

Published

This library was generated with [Nx](https://nx.dev).

Readme

nest-crud

This library was generated with Nx.

Installation

We recommend using pnpm as your package manager.

pnpm add @nest-util/nest-crud@^1.0.7 @nest-util/nest-auth@^1.1.0 typeorm@^1.1.0 @nestjs/typeorm @nestjs/swagger @nestjs/jwt @nestjs/passport class-validator class-transformer bcrypt

Features

  • Generic CRUD service with filtering, pagination, and sorting
  • Controller factory that generates 7 REST endpoints
  • Built-in audit logging with @Audit() decorator
  • Lifecycle hooks (before/after) with transaction support
  • Cursor-based pagination for efficient large-dataset traversal
  • User-scoped record retrieval via GET /resource/mine
  • Automatic Swagger documentation
  • TypeORM exception filter for duplicate key errors

Filtering and Sorting

Filtering

Query format: ?filter[field_operator]=value (requires Express query parser set to extended).

app.getHttpAdapter().getInstance().set('query parser', 'extended');

Supported operators: eq, ne, cont, notcont, starts, ends, gte, lte, gt, lt, in, nin, isnull. Groups via filter[and][0][field_eq]=... and filter[or][0][field_eq]=....

Filterable fields must be whitelisted with allowedFilters in the service options.

Filtering by nested (related) fields

Nested relation fields use dot notation. The relation must be listed in include (so the join exists) and the full path must be whitelisted in allowedFilters:

super({
  repository,
  include: ['author', 'author.profile'],
  allowedFilters: ['title', 'author.name', 'author.profile.bio'],
});
GET /post?filter[author.name_cont]=John
GET /post?filter[author.profile.bio_starts]=Software

Nested filter keys with dots resolve against the joined alias (author.name → author.name, author.profile.bio → author_profile.bio). A nested filter whose join prefix is missing from include is silently skipped.

Sorting

GET /post?orderBy=title&orderDirection=ASC

Sort fields are whitelisted with allowedSortFields. Nested sorting works the same way:

super({
  repository,
  include: ['author'],
  allowedSortFields: ['id', 'title', 'author.name'],
});
GET /post?orderBy=author.name&orderDirection=DESC

Nested sort paths also require their join prefix to be in include. Cursor pagination keeps its fixed id ordering.

Building

Run nx build nest-crud to build the library.

Running unit tests

Run nx test nest-crud to execute the unit tests via Jest.