Skip to content

Commit

Permalink
Merge pull request #2277 from beep-beep-beep-boop/document-esm-import
Browse files Browse the repository at this point in the history
Document importing js-beautify through ESM imports
  • Loading branch information
bitwiseman authored Jun 4, 2024
2 parents 84bf9db + a7dbcb3 commit 6de9268
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,17 @@ fs.readFile('foo.js', 'utf8', function (err, data) {
});
```

If you are using ESM Imports, you can import `js-beautify` like this:

```js
// 'beautify' can be any name here.
import beautify from 'js-beautify';

beautify.js(data, options);
beautify.html(data, options);
beautify.css(data, options);
```

## Python
After installing, to beautify using Python:

Expand Down

0 comments on commit 6de9268

Please sign in to comment.