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

@tango-ts/admin

v0.9.0

Published

Schema-driven admin API for Tango: model metadata, staff-gated auth, and admin CRUD viewsets. Pure JSON — the React UI ships separately in @tango-ts/admin-ui as static assets, so this package adds no UI weight to serverless function bundles.

Readme

@tango-ts/admin

Schema-driven admin API for Tango — Django admin, split in half for serverless.

This package is the server half: pure JSON endpoints (model metadata, staff-gated auth, CRUD viewsets). The browser half is @tango-ts/admin-ui, a prebuilt React SPA served as static assets. Server code must never import the UI package — that separation is what keeps the Vercel function bundle free of React, and it is enforced by lint, manifest, and bundle-trace guards in this repo.

Usage

import { addAdminRoutes, adminModel } from '@tango-ts/admin'
import { defineProject } from '@tango-ts/server'

import { Post } from './apps/core/models.js'

export const project = defineProject({ ... })

addAdminRoutes(project, {
  models: [
    adminModel(Post, {
      listDisplay: ['id', 'title', 'published'],
      searchFields: ['title'],
      listFilters: ['published']
    })
  ]
})

The UI sidebar groups models by app. addAdminRoutes resolves each model's app from the project's app registry (project.apps), so models registered through defineApp are grouped automatically; pass adminModel(Post, { app: 'blog' }) to override, and models owned by no app fall into an "Other" section.

The sidebar also lists the project's functions (defineApp({ ..., functions })) in a Functions section. Staff can run one from the UI with a JSON payload; the invocation goes through the project's configured function transport, exactly like fn.invoke() from application code. Pass functions to addAdminRoutes to expose a different set (or [] to hide them).

Auth is the contrib-auth token model: create a staff user with createSuperuser(...), log in at POST /admin/api/auth/login/, and every admin endpoint requires Authorization: Bearer tango_... plus isStaff/isSuperuser.

Routes

Mounted under /admin/api by default:

| Route | Purpose | | --- | --- | | POST /auth/login/ | Staff-only login → { token, user } | | POST /auth/logout/ | Revoke the presented token | | GET /auth/me/ | The authenticated admin user | | GET /meta/ | Site schema — models, fields, relations, list config | | POST /functions/:app/:name/ | Run an admin-exposed function: { payload }{ result } | | GET/POST /<table>/ | List (paginated) and create | | GET/PATCH/DELETE /<table>/:id/ | Retrieve, partial update, delete |

The CRUD endpoints are regular modelViewSets configured with full-field serializers, admin authentication, and icontains filters for each searchFields entry — pagination, filtering, and ordering behave exactly like any other Tango viewset.

The meta document

GET /meta/ returns everything the generic UI needs: each model's fields (type, nullable, read-only, required, max length, choices), foreign keys resolved to their admin endpoints with a display field for pickers, list configuration, and pagination. The UI is identical for every project; all per-project shape lives in this document.

Fields declared with .choices([...]) carry their allowed values into the meta document — the UI renders them as selects, both as list filters and as form inputs.