Babel transcription for JavaScript files.
Babel transpiler lets you to execute Babel transcription for given JavaScript files.
- Add one of the options below to the pom.xml file:
<dependency>
<groupId>io.github.wniemiec-io-java</groupId>
<artifactId>babel-transpiler</artifactId>
<version>LATEST</version>
</dependency>
- Run
$ mvn install
- Use it
[...]
import wniemiec.io.java.BabelTranspiler;
[...]
BabelTranspiler babelTranspiler = new BabelTranspiler(error -> errors.add(error));
List<String> code = List.of(
"const getMessage = () => \"Hello World\";"
);
List<String> transcription = babelTranspiler.fromCode(code);
for (String line : transcription) {
System.out.println(line);
}
Property | Type | Description | Default |
---|---|---|---|
fromCode | (code: List<String>): List<String> |
Transpile JavaScript code from a list of string | - |
fromFile | (file: Path): List<String> |
Transpile JavaScript code from a file. | - |
Details about each version are documented in the releases section.
See the documentation on how you can contribute to the project here.
Name | Type | Description |
---|---|---|
dist | Directory |
Released versions |
docs | Directory |
Documentation files |
src | Directory |
Source files |