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
https://github.com/caltechlibrary/dataset/releases/latest
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.
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>