there are many code playground sites[0] that could make the process less painful for you. essentially you will need to reference the library. you can do it locally, or reference the publicly available version (most libraries have a CDN hosted version).
you could also google for the playground site + library, because there may already be a playground setup (a project with a reference to the library already set) for that library somewhere. i.e.
How do I tell what language to use with this package?
From what I can tell it uses react. I have tried node, angular, and react but this installation page confounds me [0]. as far as I understand, I have been using either npm init, ng init, or create-react-app to initialize the directory for an example project. Then I do npm install tone inside of the directory I created.
I have found this [1] playground for tone but it does not elucidate how the library should be or is referenced.
I'd like to work with generative music but the amount I must know and choose between in a js project always seems to freeze me at the project init phase.
In the process of editing this comment I have finally gotten tone.js to work. Here are the steps i followed:
npm install create-react-app
create-react-app tone-test
cd tone-test
npm install tone
add "import Tone from '../node_modules/tone'" to the top of App.js this step is what I was messing up previously i believe
then I just throw tone commands at the bottom of App.js and they play on pageload, this is exactly what I wanted for now.
you could also google for the playground site + library, because there may already be a playground setup (a project with a reference to the library already set) for that library somewhere. i.e.
[0] https://www.sitepoint.com/7-code-playgrounds/