Closed sinedied closed 3 years ago
Can you create a repository? I'm not able to reproduce this.
Ah, I think you should use import got from 'got'
instead.
import stream = require('stream');
import util = require('util');
import fs = require('fs');
import got from 'got';
const pipeline = util.promisify(stream.pipeline);
(async () => {
await pipeline(
got.stream('https://sindresorhus.com'),
fs.createWriteStream('index.html')
);
})();
Thanks, works fine this way! Most Node.js don't support native TS imports, so I didn't thought of using that. Great job on the lib BTW! 👍
Describe the bug
Actual behavior
When copying the stream code example from the README in a TypeScript project with strict mode enable, I get this error:
...
Expected behavior
No errors :)
...
Code to reproduce
Set up a TypeScript project, enable strict mode and copy the code example from readme:
Checklist