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