2.1.1 • Published 1 month ago

find-babel-config v2.1.1

Weekly downloads
2,001,489
License
MIT
Repository
github
Last release
1 month ago

find-babel-config

npm Build Status Coverage Status

Helper function to retrieve the closest Babel configuration from a specific directory.

Installation

npm install --save find-babel-config

Usage

Async

// directory can be an absolute or relative path
// If it's a relative path, it is relative to the current working directory (process.cwd())
const directory = 'src';
findBabelConfig(directory).then(({ file, config }) => {
    if (file) {
        // file is the file in which the config is found
        console.log(file);
        // config is a JS plain object with the babel config
        console.log(config);
    }
});

Sync

// directory can be an absolute or relative path
// If it's a relative path, it is relative to the current working directory (process.cwd())
const directory = 'src';
const { file, config } = findBabelConfig.sync(directory);
// if c === null, the config wasn't found
if (file) {
    // file is the file in which the config is found
    console.log(file);
    // config is a JS plain object with the babel config
    console.log(config);
}

A second parameter can be given to findBabelConfig, it specifies the depth of search. By default, this value is Infinity but you can set the value you want: findBabelConfig('src', 10).

License

MIT, see LICENSE.md for details.

babel-plugin-module-resolverdombret@fdao/babel-plugin-module-resolverrn-pdf-reader-offlinereact-native-slider-kf@infinitebrahmanuniverse/nolb-find@everything-registry/sub-chunk-1668babel-plugin-transform-testkangkk-check-imported-filekdu-jestkytheisenberg-scriptshot-zone-vuejest-kdu-preprocessorjest-fable-preprocessorjest-vue-preprocessorjest-vue-preprocessor-wsmjest-vuemelody-jest-transformnativescript-vue-jestmtva-teleport-toolnove-repository@reworkjs/core@reworkjs/reworkjs@sassanhe/babel-plugin-module-resolver@stevefan1999/babel-plugin-module-resolver@sterlingwes/babel-plugin-module-resolver@snorreeb/plugin-kit@snorreeb/plugin-sdk@virtuous/react-unit-test-suitewebpack-config-spaceshipvue-jest-babel7vue-jest-knvue-v3-yandex-metrikavue-size-trackervue-preprocessorwpify-scriptsreact-native-experts-sdkprimeton-mobile-babel-module-resolverproton-hot-cliproton-hot-cli2techpacket-build-toolsteadanteanuxt-babelreact-native-android-scoped-storagereact-native-app-bubblereact-native-component-splitterreact-native-volume-phisicalreact-native-tilt-blern-agora-ios-mrollup-plugin-node-resolve-with-sham-ui-macroubookubook-alphasingelsippi-vue2-jestsfcsham-ui-macro-jest-preprocessorsham-ui-test-helperssanipacktyuuhuy-1uhuy-2uhuy-3vue-compment@fuzeman/babel-plugin-module-resolver@genx/babel-plugin-module-resolver@futpib/babel-plugin-module-resolver@hansomware/tools@guidodizi/babel-plugin-module-resolver@innodata/vue-v3-ya-metrika@jleonardvp/babel-plugin-module-resolver@lightscript/transform@djusv/jest-vue-preprocessor@darwishdev/dash-dev@cpsubrian/babel-plugin-module-resolver@cutii/babel-plugin-module-resolver@oigroup/babel-plugin-lightscript@procore/storybook-addon@greminder/bootstrap-material-design@junvary/quasar-ui-qcascader@zalastax/nolb-findbabel-plugin-i18nbabel-plugin-module-resolver-2xbabel-plugin-module-resolver-ediababel-plugin-module-resolver-imagebabel-plugin-module-resolver-include-relativebabel-plugin-module-resolver-no-logsbabel-plugin-module-resolver-zavattababel-plugin-module-resolverinobabel-plugin-stylessbabel-plugin-sxy-module-resolverbabel-plugin-rn-module-resolverbabel-preset-joyent-portalbuatsenengcase-gg-editorcilibirken-react-native-community-image-editorbabel-timingbabel-plugin-dynamic-importbabel-plugin-require-context-polyfill
1.2.2

1 month ago

2.1.1

2 months ago

2.1.0

2 months ago

1.2.1

2 months ago

2.0.0

1 year ago

1.2.0

5 years ago

1.1.0

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago