2.1.1 • Published 2 days ago

find-babel-config v2.1.1

Weekly downloads
2,001,489
License
MIT
Repository
github
Last release
2 days 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-1668eslint-import-resolver-module-alias-rnreact-native-experts-sdkesdoc-babeljs-plugineslint-import-resolver-babel-module-aliasrn-agora-ios-m@guidodizi/babel-plugin-module-resolver@hansomware/toolsrollup-plugin-node-resolve-with-sham-ui-macro@greminder/bootstrap-material-designsanipackextplug-cli@innodata/vue-v3-ya-metrika@fuzeman/babel-plugin-module-resolver@genx/babel-plugin-module-resolver@futpib/babel-plugin-module-resolversham-ui-macro-jest-preprocessorsham-ui-test-helperssfc@jleonardvp/babel-plugin-module-resolvertyuubookubook-alphajest-kdu-preprocessorjest-fable-preprocessor@procore/storybook-addonjest-vuejest-vue-preprocessorjest-vue-preprocessor-wsmkdu-jestvue-v3-yandex-metrikavue-preprocessorvue-compmentvue-size-trackerkangkk-check-imported-filevue-jest-babel7vue-jest-knsingelsippi-vue2-jest@junvary/quasar-ui-qcascadertechpacket-build-toolsteadanteakyt@sassanhe/babel-plugin-module-resolver@reworkjs/core@reworkjs/reworkjshot-zone-vueheisenberg-scripts@lightscript/transform@oigroup/babel-plugin-lightscript@virtuous/react-unit-test-suitenativescript-vue-jestwpify-scriptswebpack-config-spaceship@stevefan1999/babel-plugin-module-resolver@sterlingwes/babel-plugin-module-resolver@snorreeb/plugin-kit@snorreeb/plugin-sdkmtva-teleport-tool@zalastax/nolb-findmelody-jest-transformbabel-preset-joyent-portalbabel-plugin-i18nbabel-plugin-require-context-polyfillbabel-plugin-rn-module-resolverbabel-plugin-sxy-module-resolverbabel-plugin-stylessbabel-plugin-variable-path-resolverbabel-timingcase-gg-editorciliprimeton-mobile-babel-module-resolver@cpsubrian/babel-plugin-module-resolverproton-hot-cliproton-hot-cli2@cutii/babel-plugin-module-resolvernove-repositorybabel-plugin-dynamic-importbabel-plugin-module-resolver-2xbabel-plugin-module-resolver-imagebabel-plugin-module-resolver-include-relativebabel-plugin-module-resolver-no-logsbabel-plugin-module-resolver-zavattababel-plugin-module-resolverinobabel-plugin-module-resolver-ediababel-plugin-transform-testbabel-plugin-transform-zlogbirken-react-native-community-image-editornuxt-babelcssesc-wbgdeadfile@darwishdev/dash-dev@djusv/jest-vue-preprocessorreact-native-tilt-ble
2.1.1

2 days ago

2.1.0

2 days ago

1.2.1

2 days 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