How to use the sucrase.getFormattedTokens function in sucrase

To help you get started, we’ve selected a few sucrase examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github alangpierce / sucrase / website / src / getTokens.ts View on Github external
export default function getTokens(code: string, transforms: Array): string {
  try {
    return getFormattedTokens(code, {transforms});
  } catch (e) {
    // eslint-disable-next-line no-console
    console.error(e);
    return e.message;
  }
}

sucrase

Super-fast alternative to Babel for when you can target modern JS runtimes

MIT
Latest version published 11 months ago

Package Health Score

82 / 100
Full package analysis