How to use capnpc-ts - 2 common examples

To help you get started, we’ve selected a few capnpc-ts examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jdiaz5513 / capnp-ts / packages / capnpc-js / src / index.ts View on Github external
export async function main() {
  return capnpc_ts
    .run()
    .then(ctx => {
      transpileAll(ctx);
    })
    .thenReturn()
    .tapCatch(reason => {
      // tslint:disable-next-line:no-console
      console.error(reason);
      process.exit(1);
    });
}
github jdiaz5513 / capnp-ts / packages / capnpc-js / src / index.ts View on Github external
const {
          line,
          character
        } = diagnostic.file.getLineAndCharacterOfPosition(diagnostic.start);

        /* tslint:disable-next-line:no-console */
        console.log(
          `${diagnostic.file.fileName}:${line + 1}:${character + 1} ${message}`
        );
      } else {
        /* tslint:disable-next-line:no-console */
        console.log(`==> ${message}`);
      }
    });

    throw new Error(capnpc_ts.errors.GEN_TS_EMIT_FAILED);
  }
}

capnpc-ts

Cap'n Proto schema compiler for TypeScript.

MIT
Latest version published 3 years ago

Package Health Score

48 / 100
Full package analysis

Popular capnpc-ts functions