how to to compile MDX by ts-node CLI #1908
-
I'm trying to execute some code test from MDX on demand and @mdx-js/mdx API by CLI, and get something trouble.
import { compile } from "@mdx-js/mdx"; //
async function main() {
const compiled = await compile(Buffer.from(":-)"));
console.log(String(compiled));
}
main();
# execute the CLI
npx ts-node -O '{"module":"commonjs"}' ./test.ts and get the error like bellow:
Finally, How to exec the TS code ? |
Beta Was this translation helpful? Give feedback.
Answered by
ChristianMurphy
Jan 24, 2022
Replies: 1 comment
-
|
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
imjeen
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ts-node
documents how to run ESM in this issue TypeStrong/ts-node#1007