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

@mock-tools/devtools

v0.2.1

Published

React DevTools UI for @mock-tools/api: launcher, Mocks, Settings.

Readme

@mock-tools/devtools

React DevTools UI для @mock-tools/api: лаунчер + Mocks / Settings.

English version

Статус: v1 + Generate/Clear + Add + Parse + response override + конструктор schema + Push Live + пагинация Response.

Установка

npm install @mock-tools/devtools @mock-tools/api react react-dom

Peers: react / react-dom ^18, @mock-tools/api ^0.2, @mock-tools/factory ^0.2.

npm: @mock-tools/devtools · Demo: GitHub Pages

import '@mock-tools/devtools/style.css';

Хуки API (dbStatus, meta table, storeAdapter, опционально seedGenerator) — в api README · хуки DevTools.

Минимальное использование

import { Api } from '@mock-tools/api';
import { DevTools } from '@mock-tools/devtools';
import '@mock-tools/devtools/style.css';

const api = new Api({
  delay: false,
  dbStatus: async () => ({
    name: 'app-idb',
    status: 'ok',
    tables: [{ name: 'servers', count: 15 }],
  }),
});

api.route.get('/servers', {
  table: 'servers',
  handler: async () => ({ items: [] }),
});

export function App() {
  return <DevTools api={api} />;
}

Props

| Prop | Смысл | | ---- | ----- | | api | Обязательный экземпляр Api | | locale? | Принудительно en | ru (иначе storage → system) | | defaultPosition? | Сид угла лаунчера, если storage пуст (bottom-left) | | defaultButtonInset? | Сид отступов в px (top / right / bottom / left, по умолчанию 12), если storage пуст — чтобы не перекрывать React Query / другие FAB | | defaultHidden? | Сид скрытого лаунчера; панель через Ctrl+Shift+M / ⌘⇧M |

Persist: префикс mock-tools.devtools.* (localStorage), включая buttonInset.

Возможности

Shell

  • Лаунчер STORE / MOCKS + круги (4 угла + отступы в px)
  • STORE → Settings; MOCKS → Mocks
  • Панель: Esc / хоткей; fullscreen; без закрытия по click-outside
  • Hidden лаунчера + хоткей всё ещё открывает панель

Settings

  • Locale EN/RU
  • Угол кнопки + отступы от краёв (px) + Hidden
  • Размер панели % + Применить (20–100); fullscreen
  • Блок Database: имя, ok/error, Refresh, раскрытие → таблицы + count
  • Logging on/off (persist mock-tools.devtools.logging) → api.use('logger', …) / api.remove('logger')

Mocks

  • Аккордеоны из api.listEndpoints()GET | POST | PATCH | PUT | DELETE с table, плюс SSE/WS из api.listPushRoutes()
  • Заголовок: [METHOD] /path + счётчик из dbStatus.tables (push: [SSE] / [WS])
  • Пусто → уведомление + Добавить; со списком → поиск + Добавить
  • Add wizard: method + path + table → manualMocks + default response override (отвечает на api.handle)
  • Expand → Response: success/error, status, режимы body schema / array / pagination / json, Reset; warning если route уже есть
  • Pagination: из БД (storeAdapter + slice) или из schema (Model.paginate) — снимок страницы при Apply
  • Expand → Schemas: именованные схемы + ref; Generate предпочитает draft
  • Push-аккордеоны: enable/period + тот же body builder; при enable api тикает payload и пропускает app-handler
  • Override / push / schema drafts — IDB DevTools, restore при mount
  • Expand с данными → Parse wizard; пустая таблица → Generate N / Clear
  • Generate также пишет минимальный конфиг в IDB (generationConfigs); Clear не удаляет конфиг
  • После мутации → Refresh dbStatus (счётчик + круг лаунчера)

Example: monitoring POST /servers/:id/reboot + override; SSE /servers/:id/metrics из Push-аккордеона.

Приёмка (v1)

| # | Проверка | | - | -------- | | A1 | Углы лаунчера + Hidden переживают reload | | A2 | Размер панели / fullscreen / Esc / Ctrl+Shift+M (⌘⇧M) | | A3 | Settings: locale, logging on/off, Database Refresh + таблицы | | A4 | Mocks: методы с table в списке; override status/body без reload; Reset возвращает handler | | A5 | Только peers: React 18 + @mock-tools/api (без лишних UI-deps) |

Живая проверка: npm run example (examples/monitoring).