UNPKG

capnpc-ts

Version:

Cap'n Proto schema compiler for TypeScript.

9 lines (6 loc) 269 B
import { readFileSync } from "fs"; import * as path from "path"; export function readFileBuffer(filePath: string): ArrayBuffer { const b = readFileSync(path.join(__dirname, "../../", filePath)); return b.buffer.slice(b.byteOffset, b.byteOffset + b.byteLength); }