Last active
October 8, 2020 01:01
-
-
Save Vehmloewff/dfc296f8bf0c02a1c75de39f0d263dd0 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { createStreaming } from "https://dprint.dev/formatter/v2.ts"; | |
const globalConfig = { | |
indentWidth: 2, | |
lineWidth: 80, | |
}; | |
console.log("before createStreaming") | |
const tsFormatter = await createStreaming( | |
fetch("https://plugins.dprint.dev/typescript-0.32.4.wasm"), | |
); | |
console.log("after createStreaming") | |
tsFormatter.setConfig(globalConfig, { | |
semiColons: "asi", | |
}); | |
// outputs: "const t = 5\n" | |
console.log(tsFormatter.formatText("file.ts", "const t = 5;")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment