Registry / serialization / read-babelrc-up

read-babelrc-up

JSON →
library1.1.0jsnpmunverified

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.

npm install read-babelrc-up
INSTALL
IMPORT
SIG · READ-BABELRC-UP
R
read-babelrc-up
serializationjavascriptv1.1.0
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

readBabelrcUp
const readBabelrcUp = require('read-babelrc-up')
import readBabelrcUp from 'read-babelrc-up'
This package is CommonJS only; ESM import will fail. Use dynamic import() if needed.
readBabelrcUp.sync
const result = readBabelrcUp.sync({ cwd: '/path' })
const { sync } = require('read-babelrc-up')
sync is a method on the default export, not a separate named export.

Demonstrates both async and sync APIs for finding and parsing the closest Babel config.

const readBabelrcUp = require('read-babelrc-up'); // Async usage readBabelrcUp({ cwd: process.cwd() }) .then(result => { console.log(result); // { babel: { presets: [...] }, path: '/path/to/.babelrc' } }) .catch(err => console.error(err)); // Sync usage const result = readBabelrcUp.sync(); console.log(result); // { babel: { presets: ['es2015', 'react'] }, path: '/Users/akameco/src/my-babel-app/.babelrc' }
Debug
Known issues
deprecatedThis package is no longer actively maintained; Babel configuration loading is better handled by Babel's own tools or cosmiconfig.
fix
Consider using @babel/core's loadPartialConfig or cosmiconfig instead.
affects: >=0.0.0
gotchaDoes 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.
fix
Use a more comprehensive config loader like cosmiconfig with babel preset.
affects: >=0.0.0
breakingDropped Node.js v6 support in version 0.4.0.
fix
Ensure Node.js >=10 is used (current engine requirement).
affects: >=0.4.0
Errors
Common errors & fixes
Cannot find module 'read-babelrc-up'
Package not installed or not in node_modules
fix
Run `npm install read-babelrc-up` or check your module path.
ERR_REQUIRE_ESM
Using ES module import syntax on a CommonJS-only package
fix
Use require() instead of import, or use dynamic import() with .mjs extension.
TypeError: readBabelrcUp.sync is not a function
Trying to destructure sync as a named export
fix
Use const sync = require('read-babelrc-up').sync; or call readBabelrcUp.sync() directly.
Upgrade
Version history
1.1.0latest on npm
Audit
Dependencies
find-uprequiredused to walk up the directory tree to find the babel config file
read-pkg-uprequiredused to read package.json when looking for the 'babel' key
Agent activity
6 hits · last 30 days
node
6
Resources
read-babelrc-up — npm install read-babelrc-up · libregistry