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

@vedapointe-shared/node-logger

v3.0.0

Published

A node.js service logger.

Readme

Vedapointe Node Logger

A shared winston logger for our Node services. In 3.x it also ships logs and traces to ClickHouse with OpenTelemetry: see docs/opentelemetry.md for how that works and every option, and docs/otel-v3-plan.md for the rollout plan.

How to run

  • npm run dev - Watch and build files to the lib dir.
  • npm run build - Build files to the lib dir.
  • npm test - Run the tests.
  • npm run lint - Lint src and test.

Setting up a service

Every service loads the preload before the app and calls initOtel() once at startup.

Express service on ECS

CMD ["node", "--require", "@vedapointe-shared/node-logger/register", "main.js"]
import {
  initOtel,
  installShutdownHooks,
  vpExpressContext,
  vpExpressRequestLogger,
} from '@vedapointe-shared/node-logger';

await initOtel({
  serviceName: process.env.APP_NAME,
  environment: process.env.APP_ENV,
  level: process.env.LOG_LEVEL,
});

app.use(vpExpressContext({ user: true, tenantId: true }));
app.use(vpExpressRequestLogger({ skip: skipHealthCheckLog }));

const server = app.listen(port);
installShutdownHooks(server);

initOtel() throws at startup when serviceName or environment is missing or invalid.

Lambda

Set NODE_OPTIONS=--require @vedapointe-shared/node-logger/register on the function (after deploying a build that uses node-logger 3.x), then:

import { initOtel, withTelemetry } from '@vedapointe-shared/node-logger';

async function main(event: ScheduledEvent) {
  await initOtel({ serviceName: vars.appName, environment: vars.appEnv });
  // ...
}

export const handler = withTelemetry(main, {
  attributes: (event) => ({ tenantGuid: tenantGuidFrom(event) }),
});

Logging

import { logger } from '@vedapointe-shared/node-logger';

logger.info('Contact plan created', { contactPlanId, actionId });
logger.warn('Retrying', { attempt });
logger.error('Failed to save contact plan', err);
  • The object after the message becomes structured attributes (filterable in ClickHouse); put ids there rather than in the message.
  • Pass errors as real Error objects; they become exception.* fields with the stack trace.
  • withLogContext({ eventUuid }, () => work()) adds attributes to every line logged inside work.
  • While logs are exported, stdout (CloudWatch) only gets warnings and errors. Everything at level goes to ClickHouse.

More in docs/opentelemetry.md.

Muting noisy requests (e.g. health checks)

vpExpressRequestLogger takes an optional skip function. It runs after the response finishes, so it can see the final res.statusCode; return true to leave a request out of the request log. Use it to mute successful health check polling without hiding failed probes:

const HEALTH_CHECK_PATHS = ['/status', '/health', '/healthz', '/ready', '/live'];

app.use(
  vpExpressRequestLogger({
    skip: (req, res) => HEALTH_CHECK_PATHS.includes(req.path) && res.statusCode === 200,
  })
);

Moving from 1.x / 2.x to 3.x

| 1.x / 2.x | 3.x | | ------------------------------------------- | -------------------------------------------------------------- | | vpLogger(options) | initOtel({ serviceName, environment, level }) | | vpExpressLogger(options) | vpExpressContext({ user: true, tenantId: true }) | | vpExpressRequestLogger(options) | vpExpressRequestLogger({ skip }) | | LoggerOptions.format: 'ecs' \| 'otel' | Removed. stdout is always ECS JSON (coloured text for local) | | registerInstrumentation() / preload file | --require @vedapointe-shared/node-logger/register | | initTracing() | Done by initOtel() | | Manual flushTracing() in a Lambda handler | withTelemetry(handler) | | process.on('SIGTERM', shutdownTracing) | installShutdownHooks(server) | | vp-trace-id / vp-request-id headers | Removed. Lines carry the real OTel trace and span ids | | Default level debug | Default level info |

Unchanged: the logger export, ECS JSON on stdout (with the log.level field the error emailer filters on), flushTracing and shutdownTracing. Node 22 or later is required.

Minor or major release

npm version minor   # or: npm version major
npm publish --access public

prepublishOnly runs automatically before publish — it lints, tests, and builds.