Error when using stdin
See original GitHub issueI have this in file.js
:
function hello() {
if (2 > 3)
console.log('for real');
}
I can run minify and pass the filename:
> minify file.js
[ 'function hello(){0}' ]
>
But I can’t pass in the content through stdin:
> cat file.js | minify --js
TypeError: minify[name](...).then is not a function
at processStream (/home/sturm/.nvm/versions/node/v8.11.3/lib/node_modules/minify/bin/minify.js:68:10)
at Socket.read (/home/sturm/.nvm/versions/node/v8.11.3/lib/node_modules/minify/bin/minify.js:39:9)
at emitNone (events.js:106:13)
at Socket.emit (events.js:208:7)
at emitReadable_ (_stream_readable.js:513:10)
at emitReadable (_stream_readable.js:507:7)
at onEofChunk (_stream_readable.js:492:3)
at readableAddChunk (_stream_readable.js:220:5)
at Socket.Readable.push (_stream_readable.js:208:10)
at Pipe.onread (net.js:626:8)
>
Issue Analytics
- State:
- Created 5 years ago
- Reactions:2
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Error in using Stdin.readLineSync(); in dart - Stack Overflow
The error you get with stdin.readLineSync() is due to null safety introduced in Dart 2.12. Just add (!) var name = stdin.readLineSync()!;.
Read more >Error reading from stdin · Issue #1364 - GitHub
Have Swiper/Ivy/Counsel installed, and run emacs as a daemon. Then connect from emacsclient(might need to restart daemon a few times, its about ...
Read more >Why does my code get a <stdin> syntax error?
Google says the most common occurrence of this error message is when the script is attempted to be opened inside of the command...
Read more >Standard Input, Standard Output, and Standard Error
Generally, when a command starts, three files are already open: stdin (standard input), stdout (standard output), and stderr (standard error).
Read more >Writing data to file - User input and error handling
stdout as outfile , the x2f function also works with standard input and/or standard output. Without sys.stdin and sys.stdout , we would need...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
👍 works like a charm.
@coderaiser Unfortunately I’m still seeing this in v4.0.2 and on master.
Repro:
Result:
Versions: