MCPcopy Index your code
hub / github.com/denosaurs/byte_type

github.com/denosaurs/byte_type @0.4.1

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.4.1 ↗ · + Follow
197 symbols 337 edges 81 files 7 documented · 4%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

byte_type

Tags Checks License

byte_type is a small helper module for efficiently working with different raw types represented as a bunch of bytes. Now with performance being close to native js performance and ergonomic interfaces!

Usage

import { Struct, u32, u8 } from "https://deno.land/x/byte_type/mod.ts";

const buffer = new ArrayBuffer(8);
const dt = new DataView(buffer);

const struct = new Struct({ "b": u8, "a": u32 });

struct.write({ b: 8, a: 32 }, dt);
console.log(struct.read(dt));
console.log(buffer);

// Output:
// { b: 8, a: 32 }
// ArrayBuffer {
//   [Uint8Contents]: <08 00 00 00 20 00 00 00>,
//   byteLength: 8
// }

Maintainers

Contribution

Pull request, issues and feedback are very welcome. Code style is formatted with deno fmt and commit messages are done following Conventional Commits spec.

Licence

Copyright 2021-2024, the denosaurs team. All rights reserved. MIT license.

Extension points exported contracts — how you extend this code

Unsized (Interface)
(no doc) [31 implementers]
src/types/unsized.ts
TypedArrayTypeConstructor (Interface)
(no doc)
src/array/typed_array.ts
Options (Interface)
(no doc)
src/types/common.ts
Sized (Interface)
(no doc)
src/types/sized.ts

Core symbols most depended-on inside this repo

read
called by 63
src/compound/union.ts
write
called by 36
src/compound/union.ts
readPacked
called by 26
src/types/unsized.ts
writePacked
called by 24
src/types/unsized.ts
createTypedArrayType
called by 11
src/array/typed_array.ts
read
called by 6
src/array/array.ts
alignmentOf
called by 5
src/util.ts
read
called by 4
src/string/prefixed_length.ts

Shape

Method 112
Class 66
Function 15
Interface 4

Languages

TypeScript100%

Modules by API surface

src/compound/sized_struct.ts11 symbols
src/small_number/mod.ts10 symbols
src/array/typed_array.ts10 symbols
src/types/unsized.ts9 symbols
src/string/prefixed_length.ts7 symbols
src/compound/union.ts7 symbols
src/compound/tuple.ts7 symbols
src/compound/tagged_union.ts7 symbols
src/compound/struct.ts7 symbols
src/array/sized_array.ts7 symbols
src/array/array.ts7 symbols
src/varint/i64_leb128.ts5 symbols

For agents

$ claude mcp add byte_type \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact