2.1.2 • Published 1 year ago

find-babel-config v2.1.2

Weekly downloads
2,001,489
License
MIT
Repository
github
Last release
1 year 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 file === null, the config wasn't found. (Also config === null)
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-testbabel-plugin-transform-zlogteadanteavue-jest-babel7vue-jest-knwpify-scriptstechpacket-build-toolsvue-compmentvantiq-reactjest-kdu-preprocessorivanpantekjest-fable-preprocessorjest-vuejest-vue-preprocessorjest-vue-preprocessor-wsmkangkk-check-imported-filejesh-calculationkdu-jesthot-zone-vueheisenberg-scriptslierah-8lierah-9lierah-1lierah-2lierah-3lierah-4lierah-5lierah-6lierah-7kytmelody-jest-transform@tlgeo/react-native-gdal@virtuous/react-unit-test-suite@zalastax/nolb-findbabel-plugin-require-context-polyfillbabel-preset-joyent-portalbabel-plugin-variable-path-resolverbabel-timingbabel-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-rn-module-resolverbabel-plugin-i18nbabel-plugin-stylessbabel-plugin-sxy-module-resolverbabel-plugin-dynamic-import@greminder/bootstrap-material-design@guidodizi/babel-plugin-module-resolver@ahmed_shaban123/react-native-currencyinput@cpsubrian/babel-plugin-module-resolverreact-native-experts-sdkrn-agora-ios-mmtva-teleport-toolubookubook-alphatyuuhuy-1uhuy-2uhuy-3yarn-react-hook-formvue-preprocessorvue-v3-yandex-metrikavue-size-trackerwebpack-config-spaceship@hansomware/tools@labiebhn_/react-native-multiplier@lightscript/transform@procore/storybook-addon@sassanhe/babel-plugin-module-resolver@reworkjs/core@reworkjs/reworkjsnativescript-vue-jestnuxt-babelreact-native-android-viewreact-native-custom-poccomponent-nextreact-native-dff-components-demoreact-native-component-splitterreact-native-ideo-rn-notificationsreact-native-geo-locatorreact-native-remote-updaterollup-plugin-node-resolve-with-sham-ui-macrosanipackreact-native-bottom-tab-designsreact-native-app-bubblereact-native-adarsh_react_native_video_playerreact-native-android-scoped-storagereact-native-android-native-viewreact-native-avinash_jha_test_pluginproton-hot-cli
2.1.2

1 year ago

1.2.2

1 year ago

2.1.1

2 years ago

2.1.0

2 years ago

1.2.1

2 years ago

2.0.0

3 years ago

1.2.0

7 years ago

1.1.0

8 years ago

1.0.1

9 years ago

1.0.0

9 years ago

0.1.1

9 years ago

0.1.0

9 years ago