Get started with prettier CDN

MIT licensed

Code formatter: Prettier formats JS/TypeScript consistently in development environments.

Tags:
  • format

Stable version

Copied!

How to start using prettier CDN


<html>
<head>
  <title>Get started with prettier CDN - cdnhub.io</title>
  <script src="https://cdn.jsdelivr.net/npm/prettier/[email protected]"></script>
</head>
<body>
  <script>
    const prettier = require('prettier/standalone');
    const fs = require('fs');
    const path = require('path');

    const filePath = path.join(__filename, 'input.js');
    const output = prettier.formatFileSync(filePath, { parser: 'babel' });

    fs.writeFileSync(filePath, output);
    console.log('Formatted file:', filePath);
  </script>
  <script src="input.js"></script>
</body>
</html>
Copied!
Copied!

All versions