Harzzshest
Harzzshest

Reputation: 67

Convert from require to import es6 module

I am trying to use these 3 lines with import instead..

const fs = require("fs");
const {promisify} = require("util");
const pipeline = promisify(require("stream").pipeline);

First 2 lines I think are as simple as:

import fs from 'fs';
import {promisify} from 'util';

How the hell do I convert the 3rd line though?! I appreciate the help!

Upvotes: 0

Views: 1269

Answers (1)

Quentin
Quentin

Reputation: 943569

Break it up.

import stream from 'stream';
const pipeline = promisify(stream.pipeline);

Upvotes: 2

Related Questions