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

@douglance/http

v0.1.0

Published

Fast, secure HTTP client for .http/.rest files with variable resolution and sensitive data redaction

Readme

http - Fast HTTP Client for .http Files

CI npm version License: MIT

Fast, secure HTTP client for .http and .rest files with variable resolution and sensitive data redaction. Compatible with VS Code REST Client and JetBrains HTTP Client formats.

✨ Features

  • 📝 .http & .rest file support - Compatible with popular IDE extensions
  • 🔐 Automatic sensitive data redaction - API keys, tokens, passwords redacted in output
  • 🌍 Variable resolution - .env files and shell environment variables
  • 📦 Binary response handling - Base64 encoding for images, PDFs, etc.
  • Fast single executable - No dependencies, built with Bun
  • 🎯 JSON output - Perfect for CI/CD and scripting
  • 🧪 Well tested - 205 tests, 93% pass rate, strict TDD

📦 Installation

Homebrew (macOS/Linux)

brew tap douglance/http
brew install http

npm

npm install -g @douglance/http

Download Binary

Download the latest release for your platform:

# macOS/Linux
chmod +x http-*
mv http-* /usr/local/bin/http

# Verify installation
http --help

🚀 Quick Start

Create an api.http file:

### get-user
GET https://jsonplaceholder.typicode.com/users/1

### create-post
POST https://jsonplaceholder.typicode.com/posts
Content-Type: application/json

{
  "title": "My Post",
  "body": "Content here",
  "userId": 1
}

Execute requests:

# List available requests
http --list

# Execute a specific request
http get-user

# Execute from specific file
http create-post -f api.http

📖 Usage

Basic Requests

### Simple GET
GET https://api.example.com/users

### POST with JSON body
POST https://api.example.com/users
Content-Type: application/json

{
  "name": "John Doe",
  "email": "[email protected]"
}

### Custom headers
GET https://api.example.com/protected
Authorization: Bearer YOUR_TOKEN
X-Custom-Header: value

Variable Resolution

Create a .env file:

BASE_URL=https://api.example.com
USER_ID=123
API_KEY=your-api-key

Use variables in requests:

### Get user with variables
GET {{BASE_URL}}/users/{{USER_ID}}
Authorization: Bearer {{API_KEY}}

### Variables in body
POST {{BASE_URL}}/posts
Content-Type: application/json

{
  "userId": {{USER_ID}},
  "title": "Post title"
}

Variable Priority:

  1. .env file (highest)
  2. Shell environment variables
  3. Error if undefined

Sensitive Data Redaction

API keys, tokens, and passwords are automatically redacted in output:

### Auth example
GET https://api.example.com/users
Authorization: Bearer sk-test-1234567890
X-API-Key: secret-key-here

Output:

{
  "request": {
    "headers": {
      "Authorization": "Bearer sk-...",
      "X-API-Key": "secret-..."
    }
  }
}

Query parameters are also redacted:

  • ?api_key=secret?api_key=***
  • ?token=abc123?token=***
  • ?password=pass?password=***

Binary Responses

Binary content (images, PDFs, etc.) is automatically detected and base64-encoded:

### Download image
GET https://httpbin.org/image/png

Output:

{
  "response": {
    "body": "[Binary data: 8.5 KB, image/png, base64-encoded]",
    "binaryData": "iVBORw0KGgoAAAANS...",
    "bodySize": 8704
  }
}

📋 Command Reference

# List all requests in current directory
http --list

# List requests in specific file
http --list -f api.http

# Execute a request
http <request-name>

# Execute from specific file
http <request-name> -f api.http

# Show help
http --help

📊 JSON Output Schema

All responses are output as JSON:

{
  "request": {
    "name": "get-user",
    "file": "api.http",
    "method": "GET",
    "url": "https://api.example.com/users/1",
    "headers": {
      "Authorization": "Bearer sk-..."
    },
    "body": "{...}"
  },
  "response": {
    "status": 200,
    "statusText": "OK",
    "headers": {
      "content-type": "application/json"
    },
    "body": "{...}",
    "bodySize": 1234,
    "binaryData": "..."
  },
  "timings": {
    "dnsLookup": 10,
    "tcpConnection": 25,
    "tlsHandshake": 50,
    "firstByte": 120,
    "total": 150
  },
  "metadata": {
    "timestamp": "2025-01-15T10:30:00.000Z"
  }
}

🔒 Security Features

  • Automatic redaction: API keys, tokens, passwords never appear in output
  • Case-insensitive matching: Catches API_KEY, Api-Key, api_key
  • Redaction patterns:
    • Headers: Authorization, X-API-Key, X-Auth-Token
    • Query params: token, key, secret, password
  • Actual requests unchanged: Redaction only affects output, not HTTP requests

🧪 Development

# Install dependencies
bun install

# Run tests
bun test

# Build
npm run build

# Build executable
npm run build:exe

# Run linter
npm run lint

# Type check
npm run typecheck

📚 Examples

See the examples directory for more usage examples:

  • basic.http - Basic HTTP methods
  • variables.http - Variable resolution examples
  • .env.example - Environment variable template

🤝 Contributing

Contributions welcome! Please see CONTRIBUTING.md for guidelines.

📄 License

MIT © Doug Lance

🙏 Acknowledgments

  • Inspired by VS Code REST Client and JetBrains HTTP Client
  • Built with Bun and TypeScript
  • Uses strict TDD methodology

🐛 Known Limitations

This is an MVP release (v0.1.0). The following features from the full requirements are not yet implemented:

  • Response handler scripts (section 8) - JavaScript execution after responses
  • Authentication flows (section 9) - OAuth, token refresh, CSRF
  • Multiple environments (section 10) - dev/staging/prod profiles
  • Pagination handling (section 11) - Automatic pagination following

See CHANGELOG.md for planned features and roadmap.

📞 Support