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

datrix-agent

v0.1.2

Published

Local API Agent for Datrix API Studio

Readme

datrix-agent

datrix-agent is a local API proxy service for Datrix API Studio. It allows a browser app to trigger local HTTP requests (including localhost APIs) through a trusted local agent.

This package now ships as a TypeScript library plus CLI:

  • CLI: run datrix-agent globally
  • Library: import helpers in Node.js projects with full .d.ts types

Features

  • Local server on http://localhost:4590
  • Health endpoint: GET /health
  • Request execution endpoint: POST /request
  • Supported methods: GET, POST, PUT, PATCH, DELETE, OPTIONS
  • Streaming-safe response handling with 10MB cap
  • 30-second request timeout
  • CORS allowlist for approved web app origins
  • Security host blocking for risky targets

Installation

npm install -g datrix-agent

For library usage in another project:

npm install datrix-agent

Build (for contributors)

npm install
npm run build

Build output is generated under dist/.

Run

datrix-agent

Optional flags:

datrix-agent --port 4590 --origins "http://localhost:3000,https://yourwebapp.com"

When running, the agent prints:

  • Datrix Local Agent running
  • Port: 4590
  • Ready to receive requests

Library Usage

import { createServer, resolveAllowedOrigins, executeRequest } from "datrix-agent";

const allowedOrigins = resolveAllowedOrigins("http://localhost:3000,https://yourwebapp.com");
createServer({ port: 4590, allowedOrigins });

const result = await executeRequest({
  url: "http://localhost:5000/api/users",
  method: "GET",
});

console.log(result.statusCode, result.body);

API Endpoints

Health

GET /health

Response:

{
  "status": "running"
}

Proxy Request

POST /request

Request body:

{
  "url": "http://localhost:5000/api/users",
  "method": "GET",
  "headers": {
    "Authorization": "Bearer token"
  },
  "body": {}
}

Success response:

{
  "status": 200,
  "headers": {},
  "data": {}
}

Frontend Example

fetch("http://localhost:4590/request", {
  method: "POST",
  headers: {
    "Content-Type": "application/json"
  },
  body: JSON.stringify({
    url: "http://localhost:5000/users",
    method: "GET"
  })
});

Security Rules

Blocked hosts:

  • 169.254.*
  • 0.0.0.0

Limits:

  • Timeout: 30 seconds
  • Max response size: 10MB

Publish to npm

npm login
npm run build
npm pack
npm publish

Recommended first publish checklist:

  1. Ensure package name availability: npm view datrix-agent
  2. Verify files being published: npm pack --dry-run
  3. Bump version before each release:
  • npm version patch for fixes
  • npm version minor for features
  • npm version major for breaking changes
  1. Publish with public access (first publish for scoped packages): npm publish --access public