You have two options for acquiring Dompiler so it exists on your computer:
- Download the browser release.
- Install with NPM.
Each option is explained below, followed by a section that explains next steps.
Option 1: Download the Browser Release
You can download the latest release here: https://github.com/Nicholas-Westby/dompiler/releases
You’ll download the ZIP file, unzip it, then inspect the files, which will be:
- events.js If you want to use events with Dompiler.
- events.min.js The minified version of the Events file.
You can use the
.js files if you want to start experimenting with Dompiler.
If you plan to use Dompiler on production, you’ll likely want the
.min.js files (because they’re smaller).
Option 2: Install with NPM
Open your terminal and change to the directory where you have your code. Then run this command from the terminal:
npm i dompiler --save-dev
This will install Dompiler into the
View the NPM page for details on how to make use of those files: https://www.npmjs.com/package/dompiler
Once you’ve acquired the files (either via download or via NPM), you can start reading the tutorial.
If you like, you can also browse the examples.
Note that the tutorial and examples all show how to use Dompiler in the browser. This is because each of them are interactive and the browser version is the easiest one to make this possible.
The only real difference between the two is that the browser version will do something like this:
import Dompiler from "./some-path/dompiler.js"; import Events from "./some-path/events.js";
The equivalent Node version would be this:
let Dompiler = require("dompiler").Dompiler, Events = require("dompiler").Events;
Other than that, they should be identical.