Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
williamniemiec committed Mar 22, 2022
1 parent 7715914 commit e99c7e1
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 12 deletions.
22 changes: 12 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,25 +38,27 @@ $ mvn install
```
[...]
import wniemiec.io.java.babel-transpiler;
import wniemiec.io.java.Standardbabel-transpilerBuilder;
import wniemiec.io.java.BabelTranspiler;
[...]
babel-transpiler babel-transpiler = Standardbabel-transpilerBuilder
.getInstance()
.outputHandler(message -> { System.out.println("babel-transpiler said " + message); })
.outputErrorHandler(message -> { System.err.println("babel-transpiler said " + message); })
.build();
BabelTranspiler babelTranspiler = new BabelTranspiler(error -> errors.add(error));
babel-transpiler.exec("echo", "hello");
List<String> code = List.of(
"const getMessage = () => \"Hello World\";"
);
List<String> transcription = babelTranspiler.fromCode(code);
for (String line : transcription) {
System.out.println(line);
}
```

## 📖 Documentation
| Property |Type|Description|Default|
|----------------|-------------------------------|-----------------------------|--------|
|implode |`(list: List<T>, delimiter: String): String`|Converts elements of a list into a string by separating each element with a delimiter| - |
|capitalize |`(text: String): String`|Converts elements of a list into a string by separating each element with a delimiter| - |
|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.| - |


## 🚩 Changelog
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/wniemiec/io/java/BabelTranspiler.java
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ public BabelTranspiler() {
// Methods
//-------------------------------------------------------------------------
/**
* Transpile JavaScript code.
* Transpile JavaScript code from a list of string.
*
* @param code JavaScript code
*
Expand Down Expand Up @@ -146,7 +146,7 @@ private List<String> parsedJavaScriptCode() throws IOException {
}

/**
* Transpile JavaScript code.
* Transpile JavaScript code from a file.
*
* @param file JavaScript file
*
Expand Down

0 comments on commit e99c7e1

Please sign in to comment.