find-babel-config

WebJar for find-babel-config

License

License

MIT
Categories

Categories

config Application Layer Libs Configuration
GroupId

GroupId

org.webjars.npm
ArtifactId

ArtifactId

find-babel-config
Last Version

Last Version

1.2.0
Release Date

Release Date

Type

Type

jar
Description

Description

find-babel-config
WebJar for find-babel-config
Project URL

Project URL

https://www.webjars.org
Source Code Management

Source Code Management

https://github.com/tleunen/find-babel-config

Download find-babel-config

How to add to project

<!-- https://jarcasting.com/artifacts/org.webjars.npm/find-babel-config/ -->
<dependency>
    <groupId>org.webjars.npm</groupId>
    <artifactId>find-babel-config</artifactId>
    <version>1.2.0</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.npm/find-babel-config/
implementation 'org.webjars.npm:find-babel-config:1.2.0'
// https://jarcasting.com/artifacts/org.webjars.npm/find-babel-config/
implementation ("org.webjars.npm:find-babel-config:1.2.0")
'org.webjars.npm:find-babel-config:jar:1.2.0'
<dependency org="org.webjars.npm" name="find-babel-config" rev="1.2.0">
  <artifact name="find-babel-config" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.npm', module='find-babel-config', version='1.2.0')
)
libraryDependencies += "org.webjars.npm" % "find-babel-config" % "1.2.0"
[org.webjars.npm/find-babel-config "1.2.0"]

Dependencies

compile (2)

Group / Artifact Type Version
org.webjars.npm : json5 jar [0.5.1,0.6)
org.webjars.npm : path-exists jar [3.0.0,4)

Project Modules

There are no modules declared in this project.

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.

Versions

Version
1.2.0
1.1.0