New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

@kentcdodds/log-module

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@kentcdodds/log-module

A CLI tool that imports a module and logs all its exports with syntax highlighting.

latest
npmnpm
Version
1.1.1
Version published
Maintainers
1
Created
Source

@kentcdodds/log-module

A CLI tool that imports a module and logs all its exports with syntax highlighting.

Usage

npx @kentcdodds/log-module ./path/to/module.ts

Or install globally:

npm install -g @kentcdodds/log-module
log-module ./path/to/module.ts

Features

  • Logs all exports with colorized output using util.inspect
  • Awaits promises and indicates when a value was awaited
  • Handles rejected promises gracefully with clean stack traces
  • Syntax-highlighted code frames for syntax errors (via @babel/code-frame)
  • Works with Node.js and Bun

Example

Given a module:

// example.ts
export const name = 'world'
export const config = { nested: { deep: true } }
export const getData = async () => ({ data: 'fetched' })
export const promise = Promise.resolve({ resolved: 'success' })
export const failing = Promise.reject(new Error('Oops'))

Running log-module example.ts outputs:

name:
  'world'

config:
  { nested: { deep: true } }

getData:
  [AsyncFunction: getData]

promise (awaited):
  { resolved: 'success' }

failing (awaited):
  rejected promise: Error: Oops
      at /path/to/example.ts:5:40

Syntax Errors

When a module has a syntax error, you get a highlighted code frame:

Failed to import module: Expected ',', got 'missing'

  1 | export const broken = {
  2 |   foo: "bar"
> 3 |   missing: "comma"
    | ^ Expected ',', got 'missing'
  4 | }

License

MIT

FAQs

Package last updated on 23 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts