liquid.pizza
liquid.pizza

Reputation: 525

How to use npm packages in an angular 2 app?

I want to send some UDP packets from my angular 2 app. While searching for a solution I found some npm packages that look like they could do the job.

I thought I could just install and use this packages in angular but it did not work. Some research reavled some howtos but they look very diferent so that I am totally confused.

Can I use every npm package with angular? If yes, how?

Upvotes: 0

Views: 181

Answers (1)

cartant
cartant

Reputation: 58400

No, not every package; there are limits. Browserify implements replacements for many of Node's built-in APIs, but not everything is possible in the browser.

This is discussed in the compatibility section of the documentation.

If a package relies upon an built-in API that is not browser-compatible - or relies upon native code - it won't work. And, as far as I am aware, sending UDP packets is not going to be possible.

Upvotes: 1

Related Questions