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

tracetrail

v4.0.1

Published

Simple request logger for Express or Express Like apps. Effortlessly record and identify input/output payloads.

Downloads

22

Readme

Tracetrail

Introducing "Tracetrail" - the npm package that streamlines the API debugging process. This package enables you to record the input and output payloads transferred to and from your client or server with ease.

Tracetrail makes it simple to find out what payload was transmitted by the client or received as a response from the server. This package is particularly created to assist you in more effectively debugging your APIs, making it a crucial tool for developers.

Payload Recorder is ideal for anybody working on a large-scale application or a basic project. It makes debugging easier, allowing you to rapidly detect and handle any problems that may develop. You can quickly navigate through the recorded payloads and receive insights into the performance of your API thanks to its user-friendly interface.

Installation

npm install tracetrail

Usage

For regular javascript code

const { TraceTrail } = require('tracetrail')

For CJS / Module Imports

import { TraceTrail } from 'tracetrail' 
import { TraceTrail } from 'tracetrail' 
import express from 'express'

const port = 4444
const app = express()

// You can use a separate database to keep things neat and clean.
const traceTrail = new TraceTrail('mongodb://localhost:27017/TraceTrail', {
  AUTO_CLEAN_RECORDS_OLDER_THAN: 10,          // Optional [Default: 60]
  AUTO_CLEAN_RECORDS_OLDER_THAN_UNIT: 'days'  // Optional [Default: days]
})

// You need to use traceTrail.MiddleWare to make this package work.
app.use(traceTrail.MiddleWare)

app.listen(port, () => {
    console.log(`App listening on port ${port}`)
})

UI

To get the inbuilt UI you can easily code it like this.

image

import { TraceTrail } from 'tracetrail'
import express from 'express'

const port = 4444
const app = express()

// You can use a separate database to keep things neat and clean.
const traceTrail = new TraceTrail('mongodb://localhost:27017/TraceTrail', {
  AUTO_CLEAN_RECORDS_OLDER_THAN: 10,          // Optional [Default: 60]
  AUTO_CLEAN_RECORDS_OLDER_THAN_UNIT: 'days'  // Optional [Default: days]
})

// Get the UI
app.use(
  '/tracetrail',
  traceTrail.UI({
    LOGIN_PASSWORD: '1234',                      // Optional [Default: 1234]
    // SALT_ROUNDS: 10,                          // Optional [Default: 12]
    // SECRET_KEY: Config.SECRET_KEY as string,  // Optional [Default: Auto]
    // JWT_EXPIRY_SECS: 60 * 60 * 24,            // Optional [Default: 1 day]
  }),
)

// You need to use traceTrail.MiddleWare to make this package work.
app.use(traceTrail.MiddleWare)

app.listen(port, () => {
    console.log(`App listening on port ${port}`)
})

Developers Guide

If you want to set up the project in your local follow these steps:

  • Terminal #1
    • Clone the repository

    • Run following command npm i

    • Create .env file and add the following bare minimum environment variables

      DB_URL=mongodb:/localhost:27017/TraceTrail
      PORT=7777
      TRACETRAIL_ENV=DEV
    • Now run npm run dev

    • Go to the examples folder and pick any file of your choice JavaScript one or TypeScript one.

    • Make sure to update the MongoDB url.


That's it, you are all set. Now you can open your browser and open http://localhost:7777/tracetrail it will open TraceTrail UI.

If you haven't changed any ports, then the following would be true.

  • Backend Server: http://localhost:7777
  • React Front End: http://localhost:7778