mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-29 00:51:29 +08:00
* Add snekfetch typings * Fix linting errors * Remove unsused import * Make interfaces and types available to import
13 lines
377 B
TypeScript
13 lines
377 B
TypeScript
import * as fs from 'fs';
|
|
import * as snekfetch from 'snekfetch';
|
|
|
|
snekfetch.get('https://s.gus.host/o-SNAKES-80.jpg')
|
|
.then(r => fs.writeFile('download.jpg', r.body));
|
|
|
|
snekfetch.get('https://s.gus.host/o-SNAKES-80.jpg')
|
|
.pipe(fs.createWriteStream('download.jpg'));
|
|
|
|
snekfetch.post('https://httpbin.org/post')
|
|
.send({ meme: 'dream' })
|
|
.then(r => console.log(r.body));
|