HenrikJoreteg / fixpack

A package.json file scrubber for the truly insane.
461 stars 29 forks source link

Add ability to validate as buffer/string instead of file #11

Open pdehaan opened 9 years ago

pdehaan commented 9 years ago

I'm using github-package-json to remotely grab package.json files from a GitHub repo, and validating them using normalize-package-data. It'd be nice if there was a way to pass a JSON object directly to fixpack instead of passing a file name so I wouldn't need to sync-save an intermediate file.

notslang commented 8 years ago

If you still need this, I've implemented it in my fork: https://github.com/slang800/fixpack/blob/7044acba82cf78a3fe67fe8203ece54069e0da71/lib/index.coffee#L112

The CLI doesn't support piped input (yet), but you can pass a string to the JS module & get back a normalized one.