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

@mantis-core/nuqs

v0.2.0

Published

Shared nuqs parsers and URL-state helpers for Mantis Core.

Readme

@mantis-core/nuqs

Reusable nuqs parsers and URL-state helpers for Mantis Core apps.

Docs

Full LLM-oriented documentation ships in the package tarball under docs/:

  • docs/parsers.mdparseAsSuperJson, parseAsStringArray, createParseAsEnumArray.
  • docs/use-data-table-query.mduseDataTableQuery: headless pagination/sorting/filtering state (local useState or nuqs URL sync), paired with PaginatedTable from @mantis-core/ui.

Scope

  • Parser factories that can be shared across apps.
  • Serialization/deserialization consistency via superjson.
  • Headless table-state (pagination/sort/filters) with optional URL sync.

Out Of Scope

  • Route-specific query contracts.
  • Domain-specific URL semantics.
  • Rendering — this package only owns state, not table/filter UI.

Public API

parseAsSuperJson: Parser<unknown>
parseAsStringArray: Parser<string[]>
createParseAsEnumArray<T extends string>(allowedValues: readonly T[]): Parser<T[]>

function useDataTableQuery<F extends Record<string, FilterDescriptor> = Record<string, never>>(
  options?: UseDataTableQueryOptions<F>,
): DataTableQuery<F>;

type FilterDescriptor =
  | { kind: "text"; default?: string }
  | { kind: "enum"; values: readonly string[]; default?: string[] }
  | { kind: "stringArray"; default?: string[] }
  | { kind: "json"; default?: unknown };

interface UseDataTableQueryOptions<F> {
  filters?: F;
  defaultPageSize?: number;   // default: 10
  defaultSort?: { field: string; order: 1 | -1 } | null; // default: null
  multiSort?: boolean;        // default: false
  urlSync?: boolean | { history?: "push" | "replace"; shallow?: boolean; keyPrefix?: string }; // default: false
}

See docs/use-data-table-query.md for the full DataTableQuery<F> return shape (page, sort, filters, setPage, toggleSort, queryParams, …).

Usage Example

import { parseAsStringArray, createParseAsEnumArray } from "@mantis-core/nuqs";

const parseStatusArray = createParseAsEnumArray(["draft", "published"] as const);

const tags = parseAsStringArray.parse('["house","blog"]');
const statuses = parseStatusArray.parse('["draft","invalid"]');
// statuses -> ["draft"]
"use client";

import { useDataTableQuery } from "@mantis-core/nuqs";

function Example() {
  const table = useDataTableQuery({
    filters: { search: { kind: "text", default: "" } },
    urlSync: true, // deep-linkable page/sort/filters
  });

  return (
    <input
      value={table.filters.search}
      onChange={(e) => table.setFilter("search", e.target.value)}
      placeholder="Search…"
    />
  );
}

Build

pnpm --filter @mantis-core/nuqs build
pnpm --filter @mantis-core/nuqs typecheck

Peer Dependencies

This package expects the consuming app to provide react. Pairing useDataTableQuery's output with a table component (e.g. PaginatedTable from @mantis-core/ui) additionally requires that package.