Saturday, 10 June 2017

What is the 'import * as ...' equivalent for require?

When using the ES6 import command, you can use an alias to import all functions from a file, for example:

import * as name from "module-name";

Is there an equivalent way to do this using require, i.e.:

const { * as name } = require('module-name');



via JoeTidee

No comments:

Post a Comment