-
Notifications
You must be signed in to change notification settings - Fork 0
Home
hhh edited this page Feb 8, 2020
·
10 revisions
To use canvasom
as a dependency, execute the following command in your project folder
npm install canvasom
and import the APIs like this:
import { Root } from "canvasom";
const root = new Root();
Or, you can just include one of the following script tag in your HTML file
<!-- via jsdelivr -->
<script type="text/javascript" crossorigin="anonymous" src="https://cdn.jsdelivr.net/npm/canvasom@latest/dist/canvasom.umd.min.js"></script>
<!-- via unpkg -->
<script type="text/javascript" crossorigin="anonymous" src="https://unpkg.com/canvasom@latest/dist/canvasom.umd.min.js"></script>
and access the APIs via the COM
global like this:
const root = new COM.Root();
Note: remember to replace
latest
in the script tag with the exact version you are using to avoid breaking your code.