Files
SpeedScope/generate-file-format-schema-json.js
Jamie Wong e39381e498 Specify file format for speedscope (#83)
This defines a JSON-based file format for speedscope.

The motivation for is primarily two things:
1. To enable others to write tools to output profiles which can be read by speedscope
2. To enable others to write tools to handle the output of speedscope, leveraging the variety of importers that speedscope supports

Fixes #65
2018-07-07 18:37:28 -07:00

14 lines
413 B
JavaScript

#!/usr/bin/env node
const child_process = require('child_process')
// Convert the file-format-spec.ts file into a json schema file
let jsonSchema = child_process.execSync(
'node_modules/.bin/quicktype --lang schema ./file-format-spec.ts',
{
encoding: 'utf8',
},
)
jsonSchema = JSON.parse(jsonSchema)
jsonSchema['$ref'] = '#/definitions/FileFormat.File'
console.log(JSON.stringify(jsonSchema, null, 4))