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

curlit

v2.0.1

Published

An Express middleware that logs a cURL command representation of incoming requests and responses. You can then copy the curl, run it or paste into postman to build a postman collection.

Readme

cUrlit - turning complexity into simplicity

  • curlit is an Express middleware that logs a multi‑line cURL command representing the incoming request and its response.

Imagine this, story time:

After months of hard work, you've built a robust API server that your customers are now using daily. One day, you realize that you need to create a Postman collection for your API—something that used to take hours of manual effort.

Now, instead of diving back into the tedious task of documenting every endpoint, you integrate the curlit middleware into your server's entry point.

Suddenly, each time a request is processed, curlit generates a ready-to-use cURL command. With a quick copy and paste, you start building your Postman collection effortlessly. What once seemed like a stressful, time-consuming chore is now a streamlined process, giving you more time to focus on enhancing your application rather than documenting it.

This is the magic of curlit—turning complexity into simplicity, one cURL command at a time.

Use cases:

  • This can be useful for debugging, testing, or reproducing API calls easily.
  • You can copy the curl, and run it.
  • Or paste into postman to build a postman collection.

Installation

npm install curlit

Usage

const express = require('express'); // or import express from 'express'
const curlit = require('curlit'); // or import curlit from 'curlit'

const app = express();

// Use JSON parsing middleware if needed
app.use(express.json());

// Use curlit middleware to log cURL commands
app.use(curlit);

app.get('/', (req, res) => {
  res.send('Hello, world!');
});

const port = process.env.PORT || 3000;
app.listen(port, () => {
  console.log(`Server running on port ${port}`);
});

How the log looks like

Request example

  • Here is an example of a GET request that has been intercepted/middlewared and logged out:
    curl --location 'http://localhost:9000/api/transactions?page=1&pageSize=10' \
    --header 'accept: application/json' \
    --header 'content-type: application/json' \
    --header 'authorization: Bearer eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJpc3MiOiJPbmxpbmUgSldUIEJ1aWxkZXIiLCJpYXQiOjE3NDAyNTY4ODYsImV4cCI6MTc3MTc5Mjg4NiwiYXVkIjoid3d3LmV4YW1wbGUuY29tIiwic3ViIjoianJvY2tldEBleGFtcGxlLmNvbSIsIkdpdmVuTmFtZSI6IkpvaG5ueSIsIlN1cm5hbWUiOiJSb2NrZXQiLCJFbWFpbCI6Impyb2NrZXRAZXhhbXBsZS5jb20iLCJSb2xlIjpbIk1hbmFnZXIiLCJQcm9qZWN0IEFkbWluaXN0cmF0b3IiXX0.TcvmooXDwMgTo2vtPWkFbhp-eOywKpfCUl7kQvMU81g' \
    --header 'x-client-id: com.example.app' \
    --header 'host: localhost:9000' \
    --header 'accept-encoding: gzip, deflate, br' \
    --header 'connection: keep-alive'

Response example:

  • Here is an example of a response that has been intercepted/middlewared and logged out:
    
    {
        "success": true,
        "records": [
            {
                "id": 123456789,
                "status": "Completed",
                "reference": "INV-98765",
                "amount": 100.5,
                "currency": "USD",
                "channel": "Credit Card",
                "paidAt": "2024-02-20T15:30:00Z",
                "customerId": "67b49ecb34975e212b9afbc0",
                "yearMonth": 202402
            },
            {
                "id": 123456790,
                "status": "Pending",
                "reference": "INV-98766",
                "amount": 50,
                "currency": "USD",
                "channel": "Mpesa",
                "paidAt": "2024-02-21T10:00:00Z",
                "customerId": "67b49ecb34975e212b9afbc0",
                "yearMonth": 202402
            }
        ],
        "total": 150.5,
        "page": 1,
        "pageSize": 2,
        "remaining": 5
    }
    

How It Works

  • Request Interception: The middleware captures the incoming request.
  • Building the cURL Command: It constructs a cURL command that includes the HTTP method, headers, data (for non-GET requests), and full URL.
  • Logging: The constructed command and response body are logged to the console.
  • Continuation: The original res.send is then called to complete the response.

License

  • MIT

Help information

Notes:

  • This package is in active development.
  • This means new features are added regularly.
  • Incase your favorite feature is missing, you can always bump a version backwards or create a pull request which will be reviewed and merged into the next release.
  • Thanks for your contribution.
  • Happy coding!

Reach out: