preserves/implementations/javascript/packages/schema/src/bin/preserves-schemac.ts

14 lines
377 B
TypeScript

import { canonicalEncode, underlying } from '@preserves/core';
import fs from 'fs';
import { readSchema } from '../reader';
export function run(): void {
const src = fs.readFileSync('/dev/stdin', 'utf-8');
fs.writeSync(1, underlying(canonicalEncode(readSchema(src))));
}
export function main(_argv: Array<string>) {
Error.stackTraceLimit = Infinity;
run();
}