Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/minodisk/dumping
A temporary server that only dumps and prints requests.
https://github.com/minodisk/dumping
csv dump form-urlencoded json npm server
Last synced: 13 days ago
JSON representation
A temporary server that only dumps and prints requests.
- Host: GitHub
- URL: https://github.com/minodisk/dumping
- Owner: minodisk
- License: apache-2.0
- Created: 2024-04-27T02:16:10.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-04-27T14:44:23.000Z (10 months ago)
- Last Synced: 2024-12-08T06:42:08.374Z (2 months ago)
- Topics: csv, dump, form-urlencoded, json, npm, server
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/dumping
- Size: 391 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# dumping
![]()
A temporary server that only dumps and prints requests.
## Usage
npm:
```bash
npx dumping
```pnpm:
```bash
pnpx dumping
```## Options
```bash
dumping --helpUsage: dumping [options]
Options:
-p, --port port to listen on (default: "3000")
-h, --help display help for command
```## Features
- Parse body if content type is:
- `text/plain`
- `application/x-www-form-urlencoded`
- `application/json`
- `text/csv`## Examples
### Text
Input:
```bash
curl -X POST -d 'Hello world!' -H "Content-Type:text/plain" http://localhost:3000
```Output:
```bash
request ==========
http://::ffff:127.0.0.1:3000
http -------------
POST /
headers -----------
{
host: 'localhost:3000',
'user-agent': 'curl/7.81.0',
accept: '*/*',
'content-type': 'text/plain',
'content-length': '12'
}
body -----------
Hello world!
```### URL encoded form data
Input:
```bash
curl -X POST -d 'foo=101&bar=102&baz=103' http://localhost:3000
```Output:
```bash
request ==========
http://::ffff:127.0.0.1:3000
http -------------
POST /
headers -----------
{
host: 'localhost:3000',
'user-agent': 'curl/7.81.0',
accept: '*/*',
'content-length': '23',
'content-type': 'application/x-www-form-urlencoded'
}
body -----------
{ foo: '101', bar: '102', baz: '103' }
```### JSON
Input:
```bash
curl -X POST -H 'Content-Type: application/json' -d '{"foo":101,"bar":102,"baz":103}' http://localhost:3000
```Output:
```bash
request ==========
http://::ffff:127.0.0.1:3000
http -------------
POST /
headers -----------
{
host: 'localhost:3000',
'user-agent': 'curl/7.81.0',
accept: '*/*',
'content-type': 'application/json',
'content-length': '112'
}
body -----------
{
foo: 101,
bar: 102,
baz: 103,
}
```### CSV
Input:
```bash
curl -X POST -H 'Content-Type: text/csv' -d $'foo,bar,baz\n0,1,2\n3,4,5\n' http://localhost:3000
```Output:
```bash
request ==========
http://::ffff:127.0.0.1:3000
http -------------
POST /
headers -----------
{
host: 'localhost:3000',
'user-agent': 'curl/7.81.0',
accept: '*/*',
'content-type': 'text/csv',
'content-length': '24'
}
body -----------
[ [ 'foo', 'bar', 'baz' ], [ '0', '1', '2' ], [ '3', '4', '5' ] ]
```