Closed kenziesimpson closed 8 years ago
ES6 import syntax can only be used with transpiling for now and is not native so far. I would think something like this might work (not tested):
import {Client as LifxClient} from 'node-lifx';
const client = new LifxClient;
client.init();
Does this work for you?
You should be able to just import the default
with:
import LifxClient from 'node-lifx';
https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/import
I'm pretty sure the second way worked for me. Thanks!
How would I be able to import this with ES6 syntax, seeing as by default you are supposed to use a
require
statement like so:How would you do this with ES6 syntax?