UNPKG
capnpc-ts
Version:
latest (0.7.0)
0.7.0
0.6.0
0.5.1
0.5.0
0.4.0
0.3.0
0.2.4
0.2.2
0.2.1
0.2.0
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
Cap'n Proto schema compiler for TypeScript.
github.com/jdiaz5513/capnp-ts
jdiaz5513/capnp-ts
capnpc-ts
/
test
/
util
/
index.ts
9 lines
(6 loc)
•
269 B
text/typescript
View Raw
1
2
3
4
5
6
7
8
9
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
); }