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

@openreachtech/mentsu-logger

v2.0.1

Published

ORT logger module to wap external package.

Readme

@openreachtech/mentsu-logger

A thin logger wrapper around winston with daily log-file rotation.

Overview

mentsu-logger provides a small, uniform logging interface (log / warn / error / debug) on top of winston. It adds:

  • printf-style message formatting (via util.format) through a params array.
  • tag support, automatically appending the current process id as a pid:<pid> tag.
  • output to both the console and daily-rotated log files (a general log and an error-only log).
  • environment-gated output: log entries are written only when NODE_ENV is production.

All logging methods return the logger instance, so calls can be chained.

Installation

Requires Node.js 20.x (the version the CI builds against).

npm install @openreachtech/mentsu-logger

It is an ES module ("type": "module"); import it with ESM import syntax.

Usage

Create a logger with MentsuLogger.create(), then call one of the level methods.

import { MentsuLogger } from '@openreachtech/mentsu-logger'

const alphaLogger = MentsuLogger.create({
  filePath: 'logs/app-',
  env: {
    NODE_ENV: 'production',
  },
})

// Simple message.
alphaLogger.log({
  message: 'What a beautiful day',
})

// printf-style formatting via `params`.
alphaLogger.warn({
  message: 'I have %d apples',
  params: [3],
})

// Custom tags (a `pid:<pid>` tag is appended automatically).
alphaLogger.error({
  message: 'Job failed',
  tags: [
    'job:AlphaSummarizer',
  ],
})

// Methods return the instance, so calls can be chained.
alphaLogger
  .debug({ message: 'step 1' })
  .debug({ message: 'step 2' })

Log entries are written only when env.NODE_ENV is production. With any other value, the level methods return the instance without emitting anything, which keeps non-production environments quiet without changing call sites.

Each entry is sent to the console and to daily-rotated files derived from filePath: a general log (<filePath>%DATE%.log) and an error-only log (<filePath>%DATE%.error.log).

API

Class members are written with the following notation.

| notation | members | | :-- | :-- | | #instanceProperty | instance property | | #instanceMethod() | instance method | | #get:instanceGetter | instance getter | | #set:instanceSetter | instance setter | | .staticProperty | static property | | .staticMethod() | static method | | .get:staticGetter | static getter | | .set:staticSetter | static setter |

MentsuLogger

The logger class exported by this package.

.create()

Factory method. Creates a MentsuLogger backed by a winston logger client.

MentsuLogger.create({
  filePath,
  maxFileSize,
  env,
  nodeProcess,
})

| parameter | type | required | description | | :-- | :-- | :-- | :-- | | filePath | string | yes | Base path used to build the rotated log file names. | | maxFileSize | number | no | Maximum size (in bytes) of a rotated file. Defaults to 1048576 (1 MiB). | | env | { [key: string]: string } | no | Environment map. NODE_ENV gates whether entries are written (production enables output). | | nodeProcess | { pid: number } | no | Process-like object. Defaults to the global process; its pid is appended as a pid:<pid> tag. |

Returns a MentsuLogger instance.

#log()

Writes an entry at the info level.

alphaLogger.log({
  message,
  params,
  tags,
})

| parameter | type | required | description | | :-- | :-- | :-- | :-- | | message | string | yes | Message, optionally with util.format placeholders (e.g. %s, %d). | | params | Array<*> | no | Values substituted into the message placeholders. Defaults to []. | | tags | Array<string> | no | Tags attached to the entry. A pid:<pid> tag is appended automatically. Defaults to []. |

Returns the MentsuLogger instance for method chaining.

#warn()

Writes an entry at the warn level. Same parameters and return value as #log().

#error()

Writes an entry at the error level. Same parameters and return value as #log().

#debug()

Writes an entry at the debug level. Same parameters and return value as #log().

Contribution

Bug reports, feature requests, and code contributions are welcome.

Feel free to contact us through GitHub Issues.

git clone https://github.com/openreachtech/mentsu-logger.git
cd mentsu-logger
npm install
npm run lint
npm test

License

This project is released under the MIT License.

For more details, please see in the LICENSE file.

Developer

Open Reach Tech Inc.

Copyright

© 2026 Open Reach Tech Inc.