mirror of
https://github.com/Wessel/wumpfetch.git
synced 2026-06-06 07:35:42 +02:00
A lot has been renovated and some small things has been added to v0.3.0: * Added profiles (`getProfile`, `setProfile`, `setDefaults`) * Renamed `Collection` to `MemoryCollection` * Made `wumpfetch.userAgent` read-only * Renamed `__test__` to `tests` * Removed the `dist` folder * Changed the tab size from `4` to `2` in the declarations file and wumpfetch TS test file * Added JSdoc to `WumpRequest` and `WumpResponse` * Fixed up some of the weird spacing in `WumpRequest` and `WumpResponse` * Cleaned up all test files
15 lines
453 B
TypeScript
15 lines
453 B
TypeScript
import wump from '../lib';
|
|
import util from 'util';
|
|
|
|
console.log(`Using wumpfetch v${wump.version} [${wump.userAgent}]`);
|
|
|
|
;(async() => {
|
|
const requests = [
|
|
await wump('https://httpbin.org/get', 'GET').send(),
|
|
await wump('https://httpbin.org/get', { method: 'GET', chaining: false })
|
|
];
|
|
|
|
console.log(`Test 1: \n${util.inspect(requests[0].parse())}\n`);
|
|
console.log(`Test 2: \n${util.inspect(requests[1].json())}\n`);
|
|
})();
|