cli input from stdin will fail in windows environment
https://github.com/duaraghav8/Solium/blob/d6bba6465b6c12fc07efd325c9df29f1e78f3cf9/lib/cli.js#L178
input is currently being read using fs module from /dev/stdin - wat!? Okay so the named pipe will obviously be available in Linux environments, but not in windows. Need to account for environment in which solium is running.
process.stdin should work in all environments.
So I dug deeper into this. The aim here is to read the source code from stdin synchronously.
This is done perfectly as of now (var sourceCode = fs.readFileSync ('/dev/stdin', 'utf-8');), but it won't work for windows.
This piece is straightforward and keeps things clean, but is asynchronous. So we'd have to introduce callbacks/promises at a lot of places.
This is a WIP.
Yes, get used to using callbacks and promises a lot. node is not meant for synchronous stuff.
One alternative (once you configure Babel for ES6) is to use async/await.
This is how ESLint does it:
https://github.com/eslint/eslint/blob/6791d189da84bd1a06b326e645f021e4a74bd2e0/bin/eslint.js#L59-L75
It's styll async, but they do it before calling the main execute method. Maybe something like that could be done in bin/solium.js?