CL-js provides a Javascript ESM for working with Caltech Library content. It is implemented as a TypeScript module. Installation is usually a matter of unzipping the lastest release and copying the CL-v1.js
or CL-v1.ts
into your web tree or project directory where you normally place you JavaScript or TypeScript files. Then you reference that location to include it in your web pages.
If you want to use the production version we use at Caltech Library you can use the following script element in your web page.
<script type="module" src="https://feeds.library.caltech.edu/scripts/CL-v1.js"></script>
The latest releases can always be found at
In the following steps I'm assuming you're working in JavaScript and your web directory is located at /var/www/htdocs
. I assume you are storing your JavaScript modules in /var/www/htdocs/modules
and you have permission to read/write files in those directories.
- Goto https://github.com/caltechlibrary/cl-js/releases/latest
- Download the cl-js-VERSION.zip file (VERSION is replaced with the current version number, e.g. v1.0.0)
- Unzip the cl-js-VERSION.zip file
- Copy module/CL-v1.js to /var/www/htdocs/modules/
- Update your web page and you're done
Here are the command line steps I took for version v1.0.0.
curl -O https://github.com/caltechlibrary/cl-js/releases/download/v1.0.0/cl-js-v1.0.0.zip
unzip cl-js-v1.0.0.zip
cp modules/*.js /var/www/htdocs/modules/
From here I can include the JavaScript in the web pages that need it.
<script type="module" src="/scripts/CL-v1.js"></script>