Uglifyjs: Impossible to read from STDIN

Created on 6 May 2017  路  2Comments  路  Source: mishoo/UglifyJS

Bug report

ES5 input

uglify-js version 3.0.0

JavaScript input

alert('Hello world')

The uglifyjs CLI command executed or minify() options used.

$ cat www/js/basic.js | uglifyjs -

JavaScript output produced and/or the error or warning.

ERROR: ENOENT: no such file or directory, open '-'

On https://github.com/mishoo/UglifyJS2 it's written that "[email protected] has a new API and CLI and is not backwards compatible", but it's also written that "If you want to read from STDIN instead, pass a single dash instead of input files."

So how to read from STDIN with [email protected]?

Most helpful comment

$ cat www/js/basic.js | uglifyjs should work - that part of the documentation is leftover from 2.x, although even back then I never need to pass anything to CLI to read from STDIN.

All 2 comments

$ cat www/js/basic.js | uglifyjs should work - that part of the documentation is leftover from 2.x, although even back then I never need to pass anything to CLI to read from STDIN.

Thanks a lot @alexlamsl ! I was ready to write a PR to update the documentation but you are too fast! Thanks again.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

kzc picture kzc  路  5Comments

alexlamsl picture alexlamsl  路  4Comments

Havunen picture Havunen  路  5Comments

utdrmac picture utdrmac  路  4Comments

diegocr picture diegocr  路  3Comments