Document importing js-beautify through ESM imports

This commit is contained in:
hello 2024-06-03 11:46:38 -06:00 committed by GitHub
parent 84bf9db10d
commit a7dbcb3f00
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -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: