Getting Started
bash
npm install charmingjs
There are several way to using Charming.
Try Online
Charming uses Observable Notebook as its playground, try this starter notebook!
Installing from Package Manager
Charming is typically installed via a package manager such as Yarn or NPM.
sh
$ npm add -S charmingjs
sh
$ pnpm add -S charmingjs
sh
$ yarn add -S charmingjs
sh
$ bun add -S charmingjs
Charming can then imported as a namespace:
js
import * as cm from "charmingjs";
Imported as an ES module
In vanilla HTML, Charming can be imported as an ES module, say from jsDelivr:
html
<script type="module">
import * as cm from "https://cdn.jsdelivr.net/npm/charmingjs/+esm";
const node = cm.svg`<svg></svg>`;
document.body.append(node);
</script>
UMD Bundle
Charming is also available as a UMD bundle for legacy browsers.
html
<script src="https://cdn.jsdelivr.net/npm/charmingjs"></script>
<script>
const node = cm.svg`<svg></svg>`;
document.body.append(node);
</script>