Installations
npm install byffer.ts
Developer Guide
Typescript
Yes
Module System
CommonJS
Node Version
18.16.0
NPM Version
9.5.1
Score
72.9
Supply Chain
82
Quality
77.1
Maintenance
100
Vulnerability
100
License
Releases
Contributors
Unable to fetch Contributors
Languages
TypeScript (91.19%)
JavaScript (8.81%)
Developer
premiering
Download Statistics
Total Downloads
181
Last Day
1
Last Week
1
Last Month
10
Last Year
181
GitHub Statistics
2 Stars
26 Commits
1 Watching
1 Branches
1 Contributors
Bundle Size
2.01 kB
Minified
624.00 B
Minified + Gzipped
Package Meta Information
Latest Version
1.0.1
Package Id
byffer.ts@1.0.1
Unpacked Size
37.24 kB
Size
4.39 kB
File Count
10
NPM Version
9.5.1
Node Version
18.16.0
Publised On
28 Apr 2024
Total Downloads
Cumulative downloads
Total Downloads
181
Last day
0%
1
Compared to previous day
Last week
-66.7%
1
Compared to previous week
Last month
66.7%
10
Compared to previous month
Last year
0%
181
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
byffer.ts
An easy library to read and manipulate byte buffers in TypeScript.
It is also on npm
here.
Installation
Installation is made easy with npm
1npm install byffer.ts
Using byffer.ts
You can create a ByteBuf
instance to store and read manipulate your data.
It can be created empty, or using pre-existing data.
Here's an example of using byffer.ts:
1import ByteBuf from 'byffer.ts';
2
3// Create an empty buffer with 128 bytes
4let buf: ByteBuf = ByteBuf.emptyBuffer(128);
5// or, use an existing ArrayBuffer like class (ArrayBufferLike)
6buf = ByteBuf.from(awesome_buffer);
7
8// You can then write some data
9buf.writeInt(1337);
10buf.writeByteUnsigned(255);
11buf.writeByteString("I'm saying hi, from byffer!");
12buf.writeFloat(-999999.3125);
13
14// Then you can take back the data as an ArrayBuffer
15let data: ArrayBuffer = buf.bytes();
16
17// Or, read the data
18let i = buf.readInt(); // Returns 1337
19let b = buf.readByteUnsigned(); // Returns 255
20let s = buf.readByteString(); // Returns "I'm saying hi, from byffer!"
21let f = buf.readFloat(); // Returns -999999.3125
License
byffer.ts is licensed under the MIT license. You can do pretty much whatever you want to with this code.
No vulnerabilities found.
No security vulnerabilities found.