Skip to content

Commit c0dd8db

Browse files
Update docs
1 parent df83f90 commit c0dd8db

File tree

2 files changed

+33
-18
lines changed

2 files changed

+33
-18
lines changed

API.md

+24-13
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# API documentation
22

3-
The long term goal for LLRT is to become [Winter CG compliant](https://github.com/wintercg/admin/blob/main/proposals.md). Not every API from node will be supported.
3+
> [!NOTE]
4+
> The long term goal for LLRT is to become [Winter CG compliant](https://github.com/wintercg/admin/blob/main/proposals.md). Not every API from Node.js will be supported.
45
56
## buffer
67

@@ -16,6 +17,9 @@ Everything else inherited from [Uint8Array](https://developer.mozilla.org/en-US/
1617

1718
## child_process
1819

20+
> [!WARNING]
21+
> `spawn` uses native streams that is not 100% compatible with the Node.js Streams API.
22+
1923
[spawn](https://nodejs.org/api/child_process.html#child_processspawncommand-args-options)
2024

2125
## crypto
@@ -40,10 +44,13 @@ Everything else inherited from [Uint8Array](https://developer.mozilla.org/en-US/
4044

4145
Available globally
4246

43-
[fetch](https://developer.mozilla.org/en-US/docs/Web/API/fetch) _There are some differences with the [WHATWG standard](https://fetch.spec.whatwg.org). Mainly browser specific behavior is removed:_
44-
* `keepalive` is always true
45-
* `body` can only be `string`, `Array`, `ArrayBuffer` or `Uint8Array`
46-
* `mode`, `credentials`, `referrerPolicy`, `priority`, `cache` is not available/applicable
47+
[fetch](https://developer.mozilla.org/en-US/docs/Web/API/fetch)
48+
49+
> [!IMPORTANT]
50+
> There are some differences with the [WHATWG standard](https://fetch.spec.whatwg.org). Mainly browser specific behavior is removed:
51+
> * `keepalive` is always true
52+
> * `body` can only be `string`, `Array`, `ArrayBuffer` or `Uint8Array`
53+
> * `mode`, `credentials`, `referrerPolicy`, `priority`, `cache` is not available/applicable
4754
4855
## fs/promises
4956

@@ -76,7 +83,10 @@ export function decode(value:string):Uint8Array
7683

7784
## module
7885

79-
[createRequire](https://nodejs.org/api/module.html#modulecreaterequirefilename) _Require is available from esm modules natively. This function is just for compatibility_
86+
[createRequire](https://nodejs.org/api/module.html#modulecreaterequirefilename)
87+
88+
> [!NOTE]
89+
> `require` is available from esm modules natively. This function is just for compatibility
8090

8191
## os
8292

@@ -112,7 +122,7 @@ export function decode(value:string):Uint8Array
112122

113123
## timers
114124

115-
Also available globally
125+
_Also available globally_
116126

117127
[setImmediate](https://nodejs.org/api/timers.html#setimmediatecallback-args)
118128

@@ -128,12 +138,12 @@ Also available globally
128138

129139
## util
130140

131-
_Supported encodings: hex, base64, utf8, iso88591_
141+
> [!IMPORTANT]
142+
> Supported encodings: hex, base64, utf8, iso88591.
143+
> Supported methods: `encode` & `decode`
132144

133145
[TextEncoder](https://nodejs.org/api/util.html#class-utiltextdecoder)
134146

135-
_Supports only `decode`_
136-
137147
[TextDecoder](https://nodejs.org/api/util.html#class-utiltextdecoder)
138148

139149
## uuid
@@ -179,14 +189,15 @@ export class XMLParser(options?: XmlParserOptions){
179189

180190
## net
181191

182-
_These APIs uses native streams that is not 100% compatible with the Node.js Streams API._
192+
> [!WARNING]
193+
> These APIs uses native streams that is not 100% compatible with the Node.js Streams API. Server APIs like `createSever` provides limited functionality useful for testing purposes. Serverless applications typically don't expose servers. Some server options are not supported:
194+
`highWaterMark`, `pauseOnConnect`, `keepAlive`, `noDelay`, `keepAliveInitialDelay`
183195

184196
[createConnection](https://nodejs.org/api/net.html#netcreateconnection)
185197

186198
[connect](https://nodejs.org/api/net.html#netconnect)
187199

188-
[createServer](https://nodejs.org/api/net.html#netcreateserveroptions-connectionlistener) _This module provides limited functionality useful for testing purposes. Serverless applications typically don't expose servers. Some server options are not supported:_
189-
`highWaterMark`, `pauseOnConnect`, `keepAlive`, `noDelay`, `keepAliveInitialDelay`
200+
[createServer](https://nodejs.org/api/net.html#netcreateserveroptions-connectionlistener)
190201

191202
## Misc Global objects
192203

README.md

+9-5
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ LLRT (**L**ow **L**atency **R**un**t**ime) is a lightweight JavaScript runtime d
66

77
It's is built in Rust, utilizing QuickJS as JavaScript engine, ensuring efficient memory usage and swift startup.
88

9-
LLRT is an experimental package. It is subject to change and intended only for evaluation purposes.
9+
> [!WARNING]
10+
> LLRT is an **experimental** package. It is subject to change and intended only for evaluation purposes.
1011
1112
<sub>LLRT - [DynamoDB Put, ARM, 128MB](example/functions/src/v3-lib.mjs):<sub>
1213
![DynamoDB Put LLRT](./benchmarks/llrt-ddb-put.png "LLRT DynamoDB Put")
@@ -28,8 +29,9 @@ Choose `Custom Runtime on Amazon Linux 2023`, upload `llrt-lambda-arm64.zip` or
2829

2930
Thats it 🎉
3031

31-
**Please note: Even though LLRT supports [ES2020](https://262.ecma-international.org/11.0/) it's is NOT a drop in replacement for Node.js. Consult [Compatibility matrix](#compatibility-matrix) and [API](API.md) for more details.
32-
All dependencies should be bundled for a `browser` platform and mark included `@aws-sdk` packages as external.**
32+
> [!IMPORTANT]
33+
> Even though LLRT supports [ES2020](https://262.ecma-international.org/11.0/) it's is **NOT** a drop in replacement for Node.js. Consult [Compatibility matrix](#compatibility-matrix) and [API](API.md) for more details.
34+
> All dependencies should be bundled for a `browser` platform and mark included `@aws-sdk` packages as external.
3335
3436
## Testing & ensuring compatibility
3537

@@ -45,7 +47,8 @@ The test runner also has support for filters. Using filters is as simple as addi
4547

4648
## Compatibility matrix
4749

48-
_LLRT only support a fraction of the Node.js APIs. It is **NOT** a drop in replacement for Node.js, nor will it ever be. Below is a high level overview of partially supported APIs and modules. For more details consult the [API](API.md) documentation_
50+
> [!NOTE]
51+
> LLRT only support a fraction of the Node.js APIs. It is **NOT** a drop in replacement for Node.js, nor will it ever be. Below is a high level overview of partially supported APIs and modules. For more details consult the [API](API.md) documentation
4952
5053
| | Node.js | LLRT ⚠️ |
5154
| ------------- | ---------------------------------------- | ----- |
@@ -177,7 +180,8 @@ V3 SDK packages not included in the list bellow have to be bundled with your sou
177180

178181
Same principle as dependencies applies when using TypeScript. TypeScript must be bundled and transpiled into ES2020 JavaScript.
179182

180-
_Note that LLRT will not support running TypeScript without transpilation. This is by design for performance reasons. Transpiling requires CPU and memory that adds latency and cost during execution. This can be avoided if done ahead of time during deployment._
183+
> [!NOTE]
184+
> LLRT will not support running TypeScript without transpilation. This is by design for performance reasons. Transpiling requires CPU and memory that adds latency and cost during execution. This can be avoided if done ahead of time during deployment.
181185
182186
## Rationale
183187

0 commit comments

Comments
 (0)