Skip to content

Commit 841a0f1

Browse files
committed
bump devs & update readme
1 parent 5bad5ae commit 841a0f1

File tree

3 files changed

+93
-113
lines changed

3 files changed

+93
-113
lines changed

README.md

Lines changed: 2 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@
33
<img src="logo.png" width="400px" />
44
<br /><br />
55

6-
![Vulnerabilities][vulns-badge-url]
76
[![Version][v-badge-url]][npm-url] [![Coverage][cov-img]][cov-url] [![Github actions][gh-actions-img]][github-actions] [![Downloads][dl-badge-url]][npm-url]
87

98
</div>
@@ -15,8 +14,7 @@ Check out [deno-libs/parsec](https://github.com/deno-libs/parsec) for Deno port.
1514

1615
## Features
1716

18-
- ⏩ built with `async` / `await`
19-
- 🛠 JSON / raw / urlencoded data support
17+
- 🛠 JSON / raw / urlencoded / multipart support
2018
- 📦 tiny package size (8KB dist size)
2119
- 🔥 no dependencies
2220
-[tinyhttp](https://github.com/tinyhttp/tinyhttp) and Express support
@@ -43,28 +41,14 @@ import { createServer } from 'node:http'
4341
import { json } from 'milliparsec'
4442

4543
const server = createServer(async (req: ReqWithBody, res) => {
46-
await json()(req, res, (err) => void err && console.log(err))
44+
await json()(req, res, (err) => void err && res.end(err))
4745

4846
res.setHeader('Content-Type', 'application/json')
4947

5048
res.end(JSON.stringify(req.body))
5149
})
5250
```
5351

54-
### Web frameworks integration
55-
56-
#### tinyhttp
57-
58-
```ts
59-
import { App } from '@tinyhttp/app'
60-
import { urlencoded } from 'milliparsec'
61-
62-
new App()
63-
.use(urlencoded())
64-
.post('/', (req, res) => void res.send(req.body))
65-
.listen(3000, () => console.log(`Started on http://localhost:3000`))
66-
```
67-
6852
## API
6953

7054
### `raw(req, res, cb)`
@@ -111,7 +95,6 @@ res.end(req.body) // "THIS TEXT MUST BE UPPERCASED"
11195

11296
The parsec is a unit of length used to measure large distances to astronomical objects outside the Solar System.
11397

114-
[vulns-badge-url]: https://img.shields.io/snyk/vulnerabilities/npm/milliparsec.svg?style=for-the-badge&color=25608B&label=vulns
11598
[v-badge-url]: https://img.shields.io/npm/v/milliparsec.svg?style=for-the-badge&color=25608B&logo=npm&label=
11699
[npm-url]: https://www.npmjs.com/package/milliparsec
117100
[dl-badge-url]: https://img.shields.io/npm/dt/milliparsec?style=for-the-badge&color=25608B

package.json

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,12 +21,12 @@
2121
},
2222
"exports": "./dist/index.js",
2323
"devDependencies": {
24-
"@biomejs/biome": "1.8.3",
25-
"@types/node": "^20.14.9",
24+
"@biomejs/biome": "1.9.3",
25+
"@types/node": "^22.7.4",
2626
"c8": "10.1.2",
2727
"supertest-fetch": "^2.0.0",
2828
"tsx": "^4.19.1",
29-
"typescript": "^5.5.3"
29+
"typescript": "^5.6.2"
3030
},
3131
"files": [
3232
"dist"

0 commit comments

Comments
 (0)