{"id":20503,"library":"read-babelrc-up","title":"read-babelrc-up","description":"Utility to find and parse the closest Babel configuration file (`.babelrc`, `.babelrc.js`, `babel.config.js`, or `babel` in `package.json`) by walking up directories. Version 1.1.0 is the latest stable release, with sporadic updates and no active development cadence. It supports both async and sync APIs, returns the parsed config and file path. Compared to similar tools like `find-up` combined with `cosmiconfig`, this package provides a simpler, focused API for Babel config lookup. Requires Node >=10.","status":"maintenance","version":"1.1.0","language":"javascript","source_language":"en","source_url":"https://github.com/akameco/read-babelrc-up","tags":["javascript","babel","babelrc",".babelrc","babel.config.js","json","file","parse","load"],"install":[{"cmd":"npm install read-babelrc-up","lang":"bash","label":"npm"},{"cmd":"yarn add read-babelrc-up","lang":"bash","label":"yarn"},{"cmd":"pnpm add read-babelrc-up","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"used to walk up the directory tree to find the babel config file","package":"find-up","optional":false},{"reason":"used to read package.json when looking for the 'babel' key","package":"read-pkg-up","optional":false}],"imports":[{"note":"This package is CommonJS only; ESM import will fail. Use dynamic import() if needed.","wrong":"import readBabelrcUp from 'read-babelrc-up'","symbol":"readBabelrcUp","correct":"const readBabelrcUp = require('read-babelrc-up')"},{"note":"sync is a method on the default export, not a separate named export.","wrong":"const { sync } = require('read-babelrc-up')","symbol":"readBabelrcUp.sync","correct":"const result = readBabelrcUp.sync({ cwd: '/path' })"}],"quickstart":{"code":"const readBabelrcUp = require('read-babelrc-up');\n\n// Async usage\nreadBabelrcUp({ cwd: process.cwd() })\n  .then(result => {\n    console.log(result);\n    // { babel: { presets: [...] }, path: '/path/to/.babelrc' }\n  })\n  .catch(err => console.error(err));\n\n// Sync usage\nconst result = readBabelrcUp.sync();\nconsole.log(result);\n// { babel: { presets: ['es2015', 'react'] }, path: '/Users/akameco/src/my-babel-app/.babelrc' }","lang":"javascript","description":"Demonstrates both async and sync APIs for finding and parsing the closest Babel config."},"warnings":[{"fix":"Consider using @babel/core's loadPartialConfig or cosmiconfig instead.","message":"This package is no longer actively maintained; Babel configuration loading is better handled by Babel's own tools or cosmiconfig.","severity":"deprecated","affected_versions":">=0.0.0"},{"fix":"Use a more comprehensive config loader like cosmiconfig with babel preset.","message":"Does not support .babelrc.json, .babelrc.yaml, or other modern Babel config formats. Only .babelrc, .babelrc.js, babel.config.js, and 'babel' key in package.json.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Ensure Node.js >=10 is used (current engine requirement).","message":"Dropped Node.js v6 support in version 0.4.0.","severity":"breaking","affected_versions":">=0.4.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Run `npm install read-babelrc-up` or check your module path.","cause":"Package not installed or not in node_modules","error":"Cannot find module 'read-babelrc-up'"},{"fix":"Use require() instead of import, or use dynamic import() with .mjs extension.","cause":"Using ES module import syntax on a CommonJS-only package","error":"ERR_REQUIRE_ESM"},{"fix":"Use const sync = require('read-babelrc-up').sync; or call readBabelrcUp.sync() directly.","cause":"Trying to destructure sync as a named export","error":"TypeError: readBabelrcUp.sync is not a function"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}