log-util is a minimalist Node.js logging utility designed for terminal output. It provides a simple API for common log levels such as debug, info, success, warn, and error, allowing developers to categorize and display messages with distinct visual feedback in the console. The current stable version is 2.3.0. The package appears to be in a maintenance or stable state, with its last publish date being approximately six years ago (as of April 2026), indicating a lack of recent active development or frequent feature additions. Its primary differentiator is its simplicity and small footprint, offering basic logging capabilities without the extensive configuration or advanced features found in more comprehensive logging frameworks. It ships with TypeScript type definitions, enabling a typed development experience for users.
npm install log-utilVerified import paths — ran on the pinned version, not inferred.
Demonstrates importing `log-util`, setting the global log level, using various logging methods, and creating a separate `Log` instance with its own level.
For Node.js projects, ensure `package.json` has `"type": "module"` for full ESM support or explicitly use `require()` for this package. If using a bundler, verify its CommonJS interoperability settings.
For isolated logging contexts, instantiate `new log.Log(initialLevel)` for each context instead of relying on the globally modified `log` object. Remember that `log.Log` is a constructor accessible via the default export.
For new projects or those requiring active maintenance, consider modern logging solutions like Winston, Pino, or tslog. If maintaining `log-util`, thoroughly test its behavior in your target environment.
Ensure you are using `import log from 'log-util';` for ESM, or `const log = require('log-util');` for CommonJS. If using `import * as log from 'log-util'`, methods might be nested, e.g., `log.default.debug`.To use ESM imports, either rename your file to `.mjs`, or add `"type": "module"` to your project's `package.json` file. Alternatively, switch back to CommonJS `require()` syntax for this package.
For ES Modules, use the `import` statement: `import log from 'log-util';`. If you need to load CommonJS modules within an ES module, consider using `import { createRequire } from 'module'; const require = createRequire(import.meta.url);` as a workaround for specific cases.No dependency data recorded yet.