mirror of
https://github.com/beautifier/js-beautify.git
synced 2024-11-23 04:40:06 +00:00
Document importing js-beautify through ESM imports
This commit is contained in:
parent
84bf9db10d
commit
a7dbcb3f00
11
README.md
11
README.md
@ -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:
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user