{"id":19009,"library":"babel-log","title":"babel-log","description":"babel-log is a lightweight utility for logging Babel AST paths and nodes with clean, colored formatting in the console. As of version 2.0.0, it provides a single default-exported function that accepts any object, making it ideal for debugging Babel plugins. It is in active development with a low release cadence. Unlike manual console.log, babel-log formats complex AST structures for readability.","status":"active","version":"2.0.0","language":"javascript","source_language":"en","source_url":"ssh://git@github.com/thejameskyle/babel-log","tags":["javascript"],"install":[{"cmd":"npm install babel-log","lang":"bash","label":"npm"},{"cmd":"yarn add babel-log","lang":"bash","label":"yarn"},{"cmd":"pnpm add babel-log","lang":"bash","label":"pnpm"}],"dependencies":[],"imports":[{"note":"The package exports a single default function; named import will result in undefined.","wrong":"import { log } from 'babel-log'","symbol":"default","correct":"import log from 'babel-log'"},{"note":"CommonJS usage: the module.exports is the function itself.","wrong":"const { log } = require('babel-log')","symbol":"default","correct":"const log = require('babel-log')"},{"note":"TypeScript users may import the type for type annotations, though the default export is untyped.","wrong":"","symbol":"log (type)","correct":"import type log from 'babel-log'"}],"quickstart":{"code":"import log from 'babel-log';\n\nexport default function myBabelPlugin() {\n  return {\n    visitor: {\n      Identifier(path) {\n        log(path.node); // logs the node with pretty formatting\n      }\n    }\n  };\n}","lang":"typescript","description":"This shows how to import and use babel-log inside a Babel plugin to log AST nodes during traversal."},"warnings":[{"fix":"Use it only for debugging; do not rely on return value.","message":"The function only logs to console and returns undefined; it is not for serialization.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Use import log from 'babel-log' (without curly braces).","cause":"Importing with named import instead of default import.","error":"TypeError: log is not a function"},{"fix":"Run npm install babel-log --save-dev","cause":"Package not installed in project dependencies.","error":"Cannot find module 'babel-log'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}