anandthakker / doiuse

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

use require() to load features-json data #33

Closed groovecoder closed 8 years ago

groovecoder commented 8 years ago

I'm trying to require() the features-json data, so I can try to browserify doiuse, but I'm getting:

lcrouch:doiuse lcrouch$ node /Users/lcrouch/code/doiuse/cli.js --browsers="IE >= 8" --json /Users/lcrouch/code/doiuse/test/cases/gradient.css
[SyntaxError: Unexpected token o]

I'm not sure what would cause this? Or how to get better output - exactly where is the Unexpected token?

groovecoder commented 8 years ago

I figured it out. I had left in the JSON.parse() call after the require(). But require() takes care of parsing the JSON data already. Updated commit.

anandthakker commented 8 years ago

:+1: thanks!

Heads up, I think this will end up being pretty big for a browser bundle, thanks to the size of the caniuse-db dependency. Perhaps there's a way to slim it down, though.

Also, thanks for the other issues/PR's you filed recently -- I've been insanely busy, but I'm hoping to have a chance to take a look at them maybe this weekend...