How to use Node module functionality in Client Scripting File in frappe App

I want to use Node Module library in client side script . I download the library using npm and use it in my “JS file” with require but face the error “require is not defined” in my browser. I
read that frappe use rollup.js and ran bench build command but still same error
What is the best approach to do that? or
will you elaborate me step by step process that how to use rollup.js to use node library work in the frappe App?