The rescript package provides the rescript-tools executable:
npm install --save-dev rescriptrescript-tools --helpPrint JSON:
rescript-tools doc src/EntryPointLibFile.resWrite JSON:
rescript-tools doc src/EntryPointLibFile.res > doc.jsonrescript-tools reanalyze --helpRescriptTools.Docgen in the standard library (@rescript/runtime)
decodes the JSON that rescript-tools doc prints:
// Read JSON file and parse with `JSON.parseOrThrow`
json->RescriptTools.Docgen.decodeFromJson