How Can I Import Cleave.js npm package?

Hi guys I’ve installed this npm package. But I couldn’t import it to my website. I don’t understand which refference must be call on wix code?

This way the import seems to work, but at all it does not work…
I am still not 100% familiar with the handling and usage of NPM-packages sorry :sweat_smile:

import Cleave from 'cleave.js';

$w.onReady(()=>{
   var cleave = new Cleave($w('#input1'), {
      numeral: true, 
      numeralThousandsGroupStyle: 'thousand'
   });
   console.log(Cleave.)
});

Perhaps anybody else can shed some light on this issue.

You could surely solve this by using an HTML-Component, since in this case you will need to act with the DOM.

My question here would be:
Does using an NPM package replace the use of an HTML component?

This doesn’t work :confused: I got this message

ReferenceError: document is not defined

@J.D. @yisrael-wix do you have any idea guys?