KhronosGroup/glTF-Validator

npx support

emackey opened this issue · 3 comments

Possibly crazy idea, but I'd like to compile the command-line version of this from Dart to NodeJS. Then we could list it under bin inside package.json, and users could call it from the command line with npx:

npx gltf-validator -r -a ./2.0/

And could use it from npm test suites, etc.

Most of the CLI tool code should be compatible with node. The are some platform differences though:

  • multithreading API;
  • JSON parsing:
    • 1 vs 1.0 issue;
    • Dart's JSON parser is async and accepts chunks instead of waiting until the whole input is available.

I'm not sure what would be easier: to work-around these issues or to write a node CLI frontend for the existing npm package.

Ah, I forgot that node validation is actually less strict than native, due to JSON parsing differences.

Let's close this for now, unless there's some way to get the NodeJS version on par.

Making node validation more strict is certainly possible. It would require bringing in a custom JSON parser and data structures to keep type info.