Skip to content

Commit 68e89a8

Browse files
authored
Merge pull request #5 from vasco-santos/chore/update-form-data-docs
chore: update form data docs
2 parents a9d76fc + b75e89c commit 68e89a8

File tree

3 files changed

+22
-73
lines changed

3 files changed

+22
-73
lines changed

blob/Readme.md

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -11,16 +11,16 @@ Web API compatible [Blob][] for nodejs.
1111
#### [fetch-blob][]
1212

1313
The reason this library exists is because [fetch-blob][] chooses to compromise
14-
Web API compatibility of [`blob.stream()`][w3c blob.stream] by useing nodejs
14+
Web API compatibility of [`blob.stream()`][w3c blob.stream] by using nodejs
1515
native [Readable][] stream. We found this to be problematic when sharing code
16-
across nodejs and browser rutimes. Instead this library stays true to the
16+
across nodejs and browser runtimes. Instead this library stays true to the
1717
specification by using [ReadableStream][] implementation from [web-streams-polyfill][]
18-
library even if that is less convinient in nodejs context.
18+
library even if that is less convenient in nodejs context.
1919

2020
> Note: Both node [Readable][] streams and web [ReadableStream][] implement
21-
> `AsyncIterable` intreface and in theory either could be used with [for await][]
21+
> `AsyncIterable` interface and in theory either could be used with [for await][]
2222
> loops. In practice however major browsers do not yet ship `AsyncIterable`
23-
> support for [ReadableStream][]s wich in our experience makes choice made by
23+
> support for [ReadableStream][]s which in our experience makes choice made by
2424
> [node-fetch][] impractical.
2525
2626
[fetch-blob][] is build around node [Buffer][]s. This implementation is built
@@ -45,8 +45,8 @@ for await (const chunk of blob.stream()) {
4545
### Usage from Typescript
4646

4747
This library makes use of [typescript using JSDOC annotations][ts-jsdoc] and
48-
also generates type difinitions along with typed definition maps. So you should
49-
be able to get all the type innference out of the box.
48+
also generates type definitions along with typed definition maps. So you should
49+
be able to get all the type inference out of the box.
5050

5151
## Install
5252

form-data/Readme.md

Lines changed: 12 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -1,74 +1,23 @@
1-
# @web-std/blob
1+
# @web-std/form-data
22

33
![Node.js CI][node.js ci]
44
[![package][version.icon] ![downloads][downloads.icon]][package.url]
55
[![styled with prettier][prettier.icon]][prettier.url]
66

7-
Web API compatible [Blob][] for nodejs.
8-
9-
## Comparison to Alternatives
10-
11-
#### [fetch-blob][]
12-
13-
The reason this library exists is because [fetch-blob][] chooses to compromise
14-
Web API compatibility of [`blob.stream()`][w3c blob.stream] by useing nodejs
15-
native [Readable][] stream. We found this to be problematic when sharing code
16-
across nodejs and browser rutimes. Instead this library stays true to the
17-
specification by using [ReadableStream][] implementation from [web-streams-polyfill][]
18-
library even if that is less convinient in nodejs context.
19-
20-
> Note: Both node [Readable][] streams and web [ReadableStream][] implement
21-
> `AsyncIterable` intreface and in theory either could be used with [for await][]
22-
> loops. In practice however major browsers do not yet ship `AsyncIterable`
23-
> support for [ReadableStream][]s wich in our experience makes choice made by
24-
> [node-fetch][] impractical.
25-
26-
[fetch-blob][] is build around node [Buffer][]s. This implementation is built
27-
around standard [Uint8Array][]s.
28-
29-
[fetch-blob] chooses to use [WeakMap][]s for encapsulating private state. This
30-
library chooses to use to use properties with names that start with `_`. While
31-
those properties aren't truly private they do have better performance profile
32-
and make it possible to interop with this library, which we found impossible
33-
to do with [node-fetch][].
34-
35-
### Usage
36-
37-
```js
38-
import { Blob } from "@web-std/blob"
39-
const blob = new Blob(["hello", new TextEncoder().encode("world")])
40-
for await (const chunk of blob.stream()) {
41-
console.log(chunk)
42-
}
43-
```
44-
45-
### Usage from Typescript
46-
47-
This library makes use of [typescript using JSDOC annotations][ts-jsdoc] and
48-
also generates type difinitions along with typed definition maps. So you should
49-
be able to get all the type innference out of the box.
7+
Web API compatible [FormData][] for nodejs.
508

519
## Install
5210

53-
npm install @web-std/blob
11+
```sh
12+
npm install @web-std/form-data
13+
```
5414

55-
[node.js ci]: https://github.com/web-std/blob/workflows/Node.js%20CI/badge.svg
56-
[version.icon]: https://img.shields.io/npm/v/@web-std/blob.svg
57-
[downloads.icon]: https://img.shields.io/npm/dm/@web-std/blob.svg
58-
[package.url]: https://npmjs.org/package/@web-std/blob
59-
[downloads.image]: https://img.shields.io/npm/dm/@web-std/blob.svg
60-
[downloads.url]: https://npmjs.org/package/@web-std/blob
15+
[node.js ci]: https://github.com/web-std/io/workflows/Node.js%20CI/badge.svg
16+
[version.icon]: https://img.shields.io/npm/v/@web-std/form-data.svg
17+
[downloads.icon]: https://img.shields.io/npm/dm/@web-std/form-data.svg
18+
[package.url]: https://npmjs.org/package/@web-std/form-data
19+
[downloads.image]: https://img.shields.io/npm/dm/@web-std/form-data.svg
20+
[downloads.url]: https://npmjs.org/package/@web-std/form-data
6121
[prettier.icon]: https://img.shields.io/badge/styled_with-prettier-ff69b4.svg
6222
[prettier.url]: https://github.com/prettier/prettier
63-
[blob]: https://developer.mozilla.org/en-US/docs/Web/API/Blob/Blob
64-
[fetch-blob]: https://github.com/node-fetch/fetch-blob
65-
[readablestream]: https://developer.mozilla.org/en-US/docs/Web/API/ReadableStream
66-
[readable]: https://nodejs.org/api/stream.html#stream_readable_streams
67-
[w3c blob.stream]: https://w3c.github.io/FileAPI/#dom-blob-stream
68-
[web-streams-polyfill]:https://www.npmjs.com/package/web-streams-polyfill
69-
[for await]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/for-await...of
70-
[buffer]: https://nodejs.org/api/buffer.html
71-
[weakmap]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/WeakMap
72-
[ts-jsdoc]: https://www.typescriptlang.org/docs/handbook/jsdoc-supported-types.html
73-
[Uint8Array]:https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Uint8Array
74-
[node-fetch]:https://github.com/node-fetch/
23+
[FormData]: https://developer.mozilla.org/en-US/docs/Web/API/FormData

form-data/package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
{
22
"name": "@web-std/form-data",
33
"version": "2.1.0",
4-
"description": "Web API compatible Blob implementation",
4+
"description": "Web API compatible Form Data implementation",
55
"keywords": [
6-
"blob",
6+
"formdata",
77
"typed"
88
],
99
"type": "module",
@@ -25,7 +25,7 @@
2525
"web-streams-polyfill": "3.0.3"
2626
},
2727
"author": "Irakli Gozalishvili <[email protected]> (https://gozala.io)",
28-
"repository": "https://github.com/web-std/blob",
28+
"repository": "https://github.com/web-std/io",
2929
"license": "MIT",
3030
"devDependencies": {
3131
"@types/node": "15.0.2",

0 commit comments

Comments
 (0)