Kikobeats / finepack

Organizes and maintains readable your JSON files.
MIT License
19 stars 7 forks source link

Ability to lint by file contents or Buffer instead of file #5

Closed pdehaan closed 9 years ago

pdehaan commented 9 years ago

This would let me use finepack to lint random package.json or bower.json files directly from GitHub (via the request or wreck module).

Basically I want to scrape https://raw.githubusercontent.com/Kikobeats/finepack/master/package.json and then pass the JSON object to finepack so I can take advantage of the linters. I could use something like package-json-validator instead, but this package also supports bower and is pretty awesome.

Kikobeats commented 9 years ago

@pdehaan totally true!

I refactored the library for separate more the CLI part of the library.

Now the library just manipulate data, doesn't handle with the filesystem (I moved this part in the CLI command), so you can work with request or whatever.

Because the callback is different, I decide tagged the version as 2.x

:-)

Kikobeats commented 9 years ago

Before close the issue, can you check that works fine with requests?

Because now you have to provide a raw data and the library convert the data with JSON.parse. I want to be sure that if you for example provide a JSON object doesn't exist problem if the library parse again the object.

Kikobeats commented 9 years ago

ops, I checked that is not possible and I added a little validation in 2.0.1 tagged version ;)