Commit 047691b
committed
feat: add subpath exports for individual parsers
Add an exports field to package.json exposing json, raw, text,
and urlencoded parsers as subpath exports.
This allows consumers to import individual parsers directly:
- CommonJS: require('body-parser/json')
- ESM: import json from 'body-parser/json'
The change is fully backward compatible and enables users to
opt into loading only the parsers they need.1 parent 5740886 commit 047691b
1 file changed
+8
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
15 | 23 | | |
16 | 24 | | |
17 | 25 | | |
| |||
0 commit comments