There is also an online tool / API for this, which can be quite helpful for non npm using vanilla.js workflows.
https://closure-compiler.appspot.com/
Should be set to:
// @language_in UNSTABLE
// @language_out ECMASCRIPT_NEXT
for it to work as expected.