Installation
Table of Contents
Using yarn
or npm
(Recommended)
This method is recommended for Node.js and web browsers. You can install the library using yarn
or npm
, by running one of the following commands.
$ yarn add soundfont2
$ npm install --save soundfont2
Then include the library in your project, simply by importing it. If you want to use the library in a web browser, you can use a module bundler like Webpack or Rollup.
CommonJS
const { SoundFont2 } = require('soundfont2');
ES6 / TypeScript import
import { SoundFont2 } from 'soundfont2';
Using a <script>
tag
This method is for web browsers only. Download the latest release from here and include it in your project using a <script>
tag.
<script src="SoundFont2.js"></script>
The library will be available as window.SoundFont2
.
const { SoundFont2 } = window.SoundFont2;