anandthakker / doiuse

:bomb: Lint CSS for browser support against caniuse database.
MIT License
1.24k stars 51 forks source link

doiuse does not report anything when run as stream in a node script #18

Closed engelfrost closed 9 years ago

engelfrost commented 9 years ago

If I run doiuse from the CLI with doiuse --browsers '> 1%' tmp.css it works fine, but when I try running doiuse in a script it reports nothing:

var fs = require('fs');
var doiuse = require('doiuse/stream');

fs.createReadStream('tmp.css')
  .pipe(doiuse(['> 1%']))
  .on('data', function(usageInfo) {
    console.log(usageInfo);
  });

I'm using v1.0.2.

anandthakker commented 9 years ago

Thanks for the report! Not exactly sure what's up here--the equivalent seems to be working on my end. Any chance you could post a copy of the temp.css you're using so I can try to reproduce?

engelfrost commented 9 years ago

Sure: https://gist.github.com/engelfrost/1bc0366ece5d75e19d8e

engelfrost commented 9 years ago

I'm not sure what I changed, but I got it working today... It might have somethign to do with switching node versions, but I haven't been able to confirm/reproduce. I'll get back to this issue if I get some more information.

anandthakker commented 9 years ago

@engelfrost Huh, weird. Yeah, if it crops up again please do reopen the issue.