expr-eval
expr-eval copied to clipboard
Cannot find module
import {Parser} from 'expr-eval'
const res = Parser.evaluate('3+2 * 5 ** power', {
power: 2
})
console.log(res)
I've trying to implement expr-eval into my project today, which is written with Typescript. Then I encounter this problem. Maybe it's some problem with parser.d.ts ? Sorry I'm a newbie in coding. Thx very much for any helps!

For some reasons, it works with require instead of import {...} from '...', but with the price of loosing all the juicy code hinting and stuff. Maybe I can try write with import and switch to require when compile, but then again it's possible to loose all the juicy type assertion Typescript provides when type error occurs.
Unfortunately I have almost no experience with TypeScript. It's something I'm interested in learning more about but haven't gotten to it yet. I'll try to play around with it when I get a chance and see if I can figure it out, but I won't be much help until then.