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 🙏

© 2025 – Pkg Stats / Ryan Hefner

beckn-lightweight

v1.2.2

Published

Lightweight Node.js utilities to integrate Beckn protocol into existing BPPs

Readme

@kenpath/beckn-lightweight Lightweight Beckn protocol handler utilities for Node.js BPP (Beckn Provider Platform) services. This package simplifies handling incoming Beckn protocol requests such as search, and posting asynchronous callbacks like on_search — with minimal boilerplate.

🔧 Features ✅ Auto ACK (202) response for incoming Beckn protocol requests

🔁 Async support for posting on_search responses using the original context

🧩 Plug-and-play logic integration — just write your business function

📦 Designed for lightweight BPPs and microservices

Installation: npm install @kenpath/beckn-lightweight

Usage In your BPP Express service:

app.js:

const express = require('express');
const beckn = require('@kenpath/beckn-lightweight');
const app = express();
app.use(express.json());

app.post('/beckn/search', beckn.handleSearch(async (intent, context) => {
// Replace with internal logic or mock data
const mockCatalog = [
    { id: 'seed-101', name: 'Hybrid Maize', price: 1200, stock: 50 }
];

return {
    catalog: mockCatalog.map(p => ({
    id: p.id,
    descriptor: { name: p.name },
    price: { currency: 'INR', value: p.price.toFixed(2) },
    quantity: { available: { count: p.stock } }
    }))
};
}));

app.listen(3000, () => console.log('BPP service running on port 3000')); ✅ This will:

Respond with a 202 ACK immediately to the search call

Then call your async function

Then post the on_search response to the bap_uri provided in context

🧪 Testing Send a POST request to /beckn/search:

Request:
    {
    "context": {
        "bap_uri": "http://localhost:4000/beckn",
        "transaction_id": "tx-001",
        "message_id": "msg-001",
        "timestamp": "2025-07-16T12:00:00Z",
        "action": "search",
        "domain": "agriculture"
    },
    "message": {
        "intent": {
        "item": {
            "descriptor": { "name": "urea" }
        }
        }
    }
    }
Set up a mock BAP listener at http://localhost:4000/beckn/on_search to verify callback.

API Reference:

handleSearch(handlerFunction)

Wraps the /search endpoint.

Sends ACK immediately

Executes handlerFunction(intent, context)

Sends on_search to context.bap_uri

📃 License MIT © Kenpath