Skip to content

Commit fbf1aa8

Browse files
committed
test
1 parent 48e72b6 commit fbf1aa8

File tree

1 file changed

+32
-1
lines changed

1 file changed

+32
-1
lines changed

README.md

Lines changed: 32 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,35 @@ npm install rtp.js
4444
} = packets;
4545
```
4646

47+
```ts
48+
import { RtpPacket } from 'rtp.js/packets';
49+
50+
const rtpPacket = new RtpPacket();
51+
```
52+
4753
- The `utils` module exports some generic helpers and utilities.
4854

4955
```ts
50-
import * as utils from 'rtp.js/packets';
56+
import * as utils from 'rtp.js/utils';
57+
58+
const {
59+
padTo4Bytes,
60+
nodeBufferToDataView,
61+
dataViewToNodeBuffer,
62+
nodeBufferToArrayBuffer,
63+
arrayBufferToNodeBuffer,
64+
numericArrayToDataView,
65+
numberToDataView,
66+
dataViewToString,
67+
arrayBufferToString,
68+
stringToDataView,
69+
getStringByteLength,
70+
// etc.
71+
} = utils;
72+
```
73+
74+
```ts
75+
import { stringToDataView } from 'rtp.js/utils';
5176

5277
const view = utils.stringToDataView('fooœæ€ñ#¢∞Ω©bar');
5378
```
@@ -59,6 +84,12 @@ npm install rtp.js
5984
const utils = require('rtp.js/utils');
6085
```
6186

87+
```ts
88+
const { RtpPacket } = require('rtp.js/packets');
89+
90+
const rtpPacket = new RtpPacket();
91+
```
92+
6293
- Single entry point ("main" or "module" entries in `package.json`) is also possible for backwards compatibility:
6394

6495
```ts

0 commit comments

Comments
 (0)