How to call in frontend (frappe-ui)

I have use in frontend for frappe which is created by frappe-ui.
I need frappejs to use but in frappe’s project insights (GitHub - frappe/insights: Free and Open Source Data Analytics Tool for your Frappe Apps) they use ( without importing frappejs. How it’s possible?

And doing yarn add frappejs will give error that suggest that some package that need frappejs is running on python 2.x