snek-node
v0.0.2
Published
A node-fetch wrapper to have a Snekfetch like API
Downloads
6
Readme
snek-node
Typescript node-fetch wrapper with an snekfetch like interface
Example Usage:
import { Request: { get, post } } from 'snek-node';,
get('https://google.com')
.then(res => console.log(res.body))
.catch(console.error)
post('https://google.com')
.set('Authorization', 'Token')
.send({ data: 'important data'})
.query('site', '1')
.then(res => console.log(res.body))
.catch(console.error)
const { Request: { get, post }} = require('snek-node');
get('https://google.com')
.then(res => console.log(res.body))
.catch(console.error)
post('https://google.com')
.set('Authorization', 'Token')
.send({ data: 'important data'})
.query('site', '1')
.then(res => console.log(res.body))
.catch(console.error)