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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mb64-logs

v1.0.8

Published

Custom HTTP logger middleware

Downloads

40

Readme

About the mb64-logs package:

# mb64-logs

`mb64-logs` is an npm package that provides middleware for logging detailed request and response information in your Express.js applications. It helps developers gain insights into the API requests and responses by logging comprehensive details about each transaction, making it easier to debug and monitor their applications.

## Installation

You can install `mb64-logs` using npm:

```sh
npm install mb64-logs

Usage

Here's an example of how to use mb64-logs in an Express.js application:

const express = require("express");
const cors = require("cors");
const mblogs = require("mb64-logs");
const app = express();
const port = 3000;

app.use(cors());
mblogs(app);

app.post("/", (req, res) => {
  res.send("mblogs");
});

app.listen(port, () => {
  console.log(`Server is running on http://localhost:${port}`);
});

Example Request Log

Here's an example of the detailed request log that mb64-logs will produce:

--- Detailed Request Log ---
Method: POST
URL: /?api=asdosd
Status Code: 200
Status Description: OK
IP Address: ::1
HTTP Version: HTTP/1.1
Content Length: 6
User-Agent: PostmanRuntime/7.40.0
Response Time: undefined ms
Request Headers: {
  "content-type": "application/json",
  "user-agent": "PostmanRuntime/7.40.0",
  "accept": "*/*",
  "postman-token": "99ed9ddd-4a4c-4811-a377-b4a26e756df3",
  "host": "localhost:3000",
  "accept-encoding": "gzip, deflate, br",
  "connection": "keep-alive",
  "content-length": "26"
}
Request Params: {}
Request Query: {
  "api": "asdosd"
}
Request Body: {
  "type": "mblogs"
}
Response Body: mblogs
----------------------------------

POST /?api=asdosd 200 OK ::1 HTTP/1.1 6 "PostmanRuntime/7.40.0" - 0.790 ms

Features

  • Logs detailed information about each request and response, including headers, parameters, query strings, and body.
  • Easy to integrate with Express.js applications.
  • Helps with debugging and monitoring of API requests by providing comprehensive logs that detail each aspect of the transaction.

Contributing

Contributions are welcome! Please open an issue or submit a pull request on GitHub.

License

This project is licensed under the MIT License.

Author

Manoj Gowda B R

Contact