mirror of
https://github.com/Wessel/wumpfetch.git
synced 2026-06-05 23:25: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
23 lines
531 B
JavaScript
23 lines
531 B
JavaScript
const wump = require('../lib');
|
|
const util = require('util');
|
|
|
|
console.log(`Using wumpfetch v${wump.version} [${wump.userAgent}]`);
|
|
|
|
const profileData = {
|
|
headers: {
|
|
'Authorization': 'Wumper'
|
|
}
|
|
};
|
|
|
|
wump.setProfile('main', profileData);
|
|
console.log(wump.getProfile('main'));
|
|
|
|
wump.setDefaults(profileData);
|
|
console.log(wump.getProfile('__default__'));
|
|
|
|
;(async () => {
|
|
const req = await wump({ url: 'https://httpbin.org/get' }).send();
|
|
|
|
console.log(`Test 1: \n${util.inspect(req.parse())}`);
|
|
})();
|