skydiver / ewelink-api

eWeLink API for JavaScript
https://www.npmjs.com/package/ewelink-api
MIT License
264 stars 108 forks source link

Uncaught ReferenceError: require is not defined Ewelink #158

Open shashwatautodesk opened 3 years ago

shashwatautodesk commented 3 years ago

Getting error 'Uncaught ReferenceError: require is not defined Ewelink' while using below code. Please help. Urgent @skydiver const ewelink = require('ewelink-api');

(async () => { const connection = new ewelink({ email: 'xxxx', password: 'xxxxx', region: 'us', });

/ get all devices / const devices = await connection.getDevices(); / const devices = connection.getDevices(); / console.log(devices); })();