fhqvst / avanza

A JavaScript client for the unofficial Avanza API
MIT License
229 stars 59 forks source link

Unknown identifier? #29

Closed matsalmstrom closed 5 years ago

matsalmstrom commented 5 years ago

Hi,

I'm a noob on Node js. So most likely it is due to this.

I have installed the library and got the TOTP and registered the code i got running the command. Then I try to run the first example in the readme. But I only get;

"SyntaxError: Unexpected identifier"

complaining on "Avanza" in;

"import Avanza from 'avanza' "

Any idea?

fhqvst commented 5 years ago

Node does not yet support ES6 imports. Unless you want to use a transpiler such as Babel or a compiler such as tsc, you can always just import the library using const Avanza = require('avanza').