PEG.js in Angular 2+ app

669 Views Asked by At

I've generated a parser using PEG.js and I'm trying to use the parser in a service class. I just have no idea how to import it into my typescript class.

Do I just need to create a typescript definition file? I'm new to typescript and I'm not great at javascript to begin with, so I'm sure this is a stupid question.

Let me know if you need any additional information.

1

There are 1 best solutions below

0
On BEST ANSWER

There are already types for pegjs

https://www.npmjs.com/package/@types/pegjs

Just install and save that package and pegjs