beautifier / js-beautify

Beautifier for javascript
https://beautifier.io
MIT License
8.63k stars 1.38k forks source link

Create better exports alias #1328

Open ORESoftware opened 6 years ago

ORESoftware commented 6 years ago

In the readme, for programmatic usage, I see these two exports:

var beautify = require('js-beautify').js_beautify,
var beautify = require('js-beautify').js,

...why not do this for the programmatic API?

var beautify = require('js-beautify').beautify,

so that users can do this:

const {beautify} = require('js-beautify');

or

import {beautify} from 'js-beautify';
bitwiseman commented 6 years ago

@ORESoftware If we were to make require('js-beautify').beautify it would need to return the same thing as require('js-beautify'). And we'd need to add tests for that import style.

Other than that, seems reasonable. PR welcome.