2.1.2 • Published 10 months ago

find-babel-config v2.1.2

Weekly downloads
2,001,489
License
MIT
Repository
github
Last release
10 months 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-react@djusv/jest-vue-preprocessor@cutii/babel-plugin-module-resolver@cpsubrian/babel-plugin-module-resolverjest-kdu-preprocessorivanpantekjest-fable-preprocessorjest-vuejest-vue-preprocessorjest-vue-preprocessor-wsmkangkk-check-imported-filejesh-calculationkdu-jestreact-native-experts-sdkrn-agora-ios-mmtva-teleport-toolubookubook-alphatyuuhuy-1uhuy-2uhuy-3@aviinash_jha/react-native-test_multiply@darwishdev/dash-devyarn-react-hook-formvue-preprocessorvue-v3-yandex-metrikavue-size-trackerwebpack-config-spaceship@guidodizi/babel-plugin-module-resolver@greminder/bootstrap-material-design@hansomware/tools@fuzeman/babel-plugin-module-resolver@futpib/babel-plugin-module-resolver@genx/babel-plugin-module-resolver@innodata/vue-v3-ya-metrika@labiebhn_/react-native-multiplier@lightscript/transform@jleonardvp/babel-plugin-module-resolver@junvary/quasar-ui-qcascader@oigroup/babel-plugin-lightscript@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-cliproton-hot-cli2react-native-offline-noticereact-native-payu-paymentreact-native-lazp-device-inforeact-native-moosa-lib-for-testreact-native-sherpa-onnx-offline-ttsreact-native-superapis-transbank-posreact-native-tilt-blesfcreact-native-test-multiplier-libraryreact-native-volume-phisicalreact-native-s-airlinesreact-native-rn-common-components-examplereact-native-rn-lib-custom-componentsnove-repositoryprimeton-mobile-babel-module-resolverreact-native-sharing-intentsham-ui-macro-jest-preprocessorsham-ui-test-helperssippi-vue2-jestsingelreact-native-uart-connection
2.1.2

10 months ago

1.2.2

1 year ago

2.1.1

1 year ago

2.1.0

1 year ago

1.2.1

1 year ago

2.0.0

2 years ago

1.2.0

6 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