Home > Back-end >  Utilizing tone.js NPM install on the client side
Utilizing tone.js NPM install on the client side

Time:06-29

I feel like I'm missing something totally obvious - but I can't for the life of me figure out how to use tone.js on the client. I see information on the website for how to install it server side via npm, but don't see a CDN or other link that I can reference to in a script src to pull the framework into a client-side project.

Is there something obvious I'm missing on the github page or elsewhere to reference/download so this can be used client side?

I saw some other posts on how to convert NPM packages into client side (e.g., browserify.js) but I feel like that's overkill...there should be just a simple way to use this in the browser.

documentation about it:

https://github.com/Tonejs/Tone.js

https://tonejs.github.io/

CodePudding user response:

This is not specific to Tone, but just use JSDelivr, which is a CDN that has every NPM package.

https://cdn.jsdelivr.net/npm/[email protected]

The NPM installation instructions are targetted at people already using front-end frameworks and are already using bundlers (basically everyone who isn't using jQuery or vanilla JS).

I would recommend against investing the time to learn Browserify. If you want to tinker with one, try something more modern like Webpack (more common) or ParcelJS (easy to use).

  • Related