You can use PhysicsJS as an AMD module (requireJS), a CommonJS module, or a regular browser global.
As an AMD Module with requireJS
This is the recommended way to use PhysicsJS. Read about requireJS to learn how to set it up.
Tell requireJS where to find the PhysicsJS source.
Now require the dependencies you need.
As a browser global
Simply include the library in your html.
Start using it.
PhysicsJS was made to be modular. So any non-core functionality is separate and must be included separately. For example, if you want circles, you would have to include that script after including PhysicsJS.
This could get quite tedious, which is why using requirejs (and its optimizer) is recommended. However, if you know you’ll want most or all extras, you can use the “full” version of the script, which includes all non-core functionality.
As a node.js (commonJS) module
This has not yet been tested but it should be entirely possible to run PhysicsJS in node.js by requiring the correct file.