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

@polyglot-logger/node

v0.3.3

Published

Node.js / TypeScript bindings for the Polyglot native structured logger

Readme

@polyglot-logger/node

Node / TypeScript bindings for Polyglot — a shared Go logging core with a C ABI. Same polyglot.yaml, JSON shape, and sinks as the Python and .NET packages. Native libs ship in the npm package (Linux, Windows, macOS arm64); no Go/CGO required.

Current line: 0.3.x (npm view @polyglot-logger/node version).

npm install @polyglot-logger/node
import { Logger } from "@polyglot-logger/node";

const log = new Logger({ service: "api", stdout: true });
log.info("hello", { user_id: 1 });
log.flush();
log.close();

Side-by-side with Python/.NET: sdk.md.

Config file (optional)

Constructors load polyglot.yaml via POLYGLOT_CONFIG → cwd → parents (stop at .git). Options override file keys.

# polyglot.yaml (repo root)
service: checkout-api
environment: prod
level: info
stdout: true
file:
  enabled: true
  path: /var/log/checkout.log
new Logger({ service: "checkout-api" }); // sinks from YAML

Full schema: configuration · zero-config.

Levels, fields, lifecycle

import { Logger, Level } from "@polyglot-logger/node";

const log = new Logger({
  service: "checkout-api",
  environment: "prod",
  level: "info",
  stdout: true,
});

log.setFields({ region: "us-east" });
const req = log.with({ request_id: "r1" });
req.info("checkout started", { cartId: "c-1" });
req.logSimple(Level.ERROR, "payment declined");
req.close();

log.flush();
log.close();
  • Levels: tracefatal (fatal does not exit the process).
  • Prefer with(fields) for per-request context; avoid sharing setFields across concurrent requests.
  • One instance is fine for concurrent log / flush / stats / setFields / reloadConfig. Call close() from a single owner.

Native library

Published packages include platform natives under bin/ / native/. For a local monorepo build, point at the shared lib:

export POLYGLOT_LOGGER_LIB=$PWD/dist/liblogger.so   # logger.dll / liblogger.dylib

Intel Macs: arm64 is what ships today; set POLYGLOT_LOGGER_LIB for amd64 until CI covers it.

From source

git clone --recurse-submodules https://github.com/kishankumarhs/Polyglot.git
cd Polyglot && make build-native
cd bindings/node && npm install && npm run build

Docs

Polyglot is for multi-language stacks that want one ops model — not a drop-in “faster than Pino” replacement. Node pays an FFI tax (~1.6 µs per call in recent local runs); see the bench README for numbers.

Repos: polyglot-node · core: Polyglot

MIT