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

@nexload-sdk/payload-hooks

v1.0.6

Published

Effortless, type-safe logging for Payload CMS collection operations.

Readme

@nexload-sdk/payload-hooks


Features

  • 🚀 Declarative Logging: Easily add logging to any collection hook (beforeChange, afterChange, afterDelete, afterRead).
  • 🛡️ Type-Safe: Fully typed to ensure compatibility with Payload's hook system.
  • 🔎 Structured Logs: Captures the collection name and the type of operation being performed.
  • 🧩 Composable: A simple utility that enhances your Payload CMS collections without adding complexity.
  • 🌐 Integrated: Works seamlessly with @nexload-sdk/logger for consistent, high-performance logging.

Installation

pnpm add @nexload-sdk/payload-hooks
# or
yarn add @nexload-sdk/payload-hooks
# or
npm install @nexload-sdk/payload-hooks

Quick Start

Basic Usage

Simply import logOperation and add it to the hooks of your collection.

import { logOperation } from '@nexload-sdk/payload-hooks';
import type { CollectionConfig } from 'payload/types';

export const MyCollection: CollectionConfig = {
  slug: 'my-collection',
  hooks: {
    beforeChange: [logOperation('beforeChange')],
    afterChange: [logOperation('afterChange')],
    afterDelete: [logOperation('afterDelete')],
    afterRead: [logOperation('afterRead')],
  },
  fields: [
    // ... your fields
  ],
};

API Reference

logOperation(hookType)

  • A factory function that returns a Payload CMS hook.
  • Parameters:
    • hookType: 'beforeChange' | 'afterChange' | 'afterDelete' | 'afterRead'
  • Returns: A hook function that can be used in a collection's hooks array.

How It Works

The logOperation function is a higher-order function that takes a hookType and returns a hook function that logs the operation to the console using @nexload-sdk/logger. It automatically extracts the collection slug and includes it in the log output, providing clear and concise information about what's happening in your application.


Contributing

  1. Fork this repo, create a feature branch (feat/name)
  2. Make your changes — ensure all types, tests, and lint pass
  3. Use commit messages of the format: feat(scope): your description
  4. Open a pull request (PR) — BugBot checks and feedback required

License

MIT © GecutWeb Contributors


Branding

Built by NexLoad SDK · Enabling modern, observable, and resilient applications with top-notch developer tools.