Skip to content

Commit 6d3286f

Browse files
authored
add moddable example and link to issue 5
1 parent db9ce3c commit 6d3286f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

README.md

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -113,10 +113,18 @@ Parcel added a [data url](https://parceljs.org/features/bundle-inlining/#inlinin
113113
import background from "data-url:./background.png";
114114
```
115115

116+
Moddable added a [Resource](https://www.moddable.com/documentation/files/files#resource) class to inline a host buffer for embedded systems
117+
118+
```js
119+
let resource = new Resource("logo.bmp");
120+
```
121+
116122
### What about ArrayBuffer vs Uint8Array?
117123

118124
Both are viable solutions. Uint8Array matches the [Response.bytes()](https://developer.mozilla.org/en-US/docs/Web/API/Response/bytes) method return type as well as [Deno's implementation](https://deno.com/blog/v2.4#importing-text-and-bytes). Uint8Array is also compatible with [Node.js Buffer](https://nodejs.org/api/buffer.html#buffer) which makes it widely compatible with existing JavaScript code.
119125

126+
This is currently being discussed in https://github.com/styfle/proposal-import-bytes/issues/5
127+
120128
### What about Blob vs Uint8Array?
121129

122130
Blob is part of the W3C [File API](https://www.w3.org/TR/FileAPI/), not part of JavaScript so it is not a viable solution to include in a TC39 Proposal. Blob also includes a type and is immutable.

0 commit comments

Comments
 (0)