Installation
Installation
hmpl can be installed in several ways, which are described in this article. This tool is a simple javascript file that is connected in the usual way through a script
, or using the import
construct in an environment that supports this (webpack build, parcel build etc.). The first and easiest way is to install using a CDN.
Package Manager
This method involves downloading through npm or other package managers.
npm i hmpl-js
Node.js is required for npm.
Along the path node-modules/hmpl/dist you can find two files that contain a regular js file and a minified one.
Manual download
You can install the package by simply downloading it as a file and moving it to the project folder.
<script src="./hmpl.min.js"></script>
If, for some reason, you do not need the minified file, then you can download the full file from this link.
<script src="./hmpl.js"></script>
The non-minified file is larger in size, but it is there as it is with all the formatting.
CDN
This method involves connecting the file through a third-party resource, which provides the ability to obtain a javascript file from npm via a link.
<script
src="https://unpkg.com/hmpl-js@2.1.7/dist/hmpl.min.js"
integrity="sha384-sS8g4x4OiOuWGfKTzNVEg0aqv3YczY+l/Rm7g2ZfN8X7tX0h2k2+dq1HusGH+WqB"
crossorigin="anonymous"
></script>
This resource could be unpkg, skypack or other resources. The examples include unpkg simply because it is one of the most popular and its url by characters is not so long.