Automatically updates hosted projects on jsDelivr CDN.
libgrabber is a bot that runs on jsDelivr's servers to auto-update projects. There are three simple steps to enable auto-updating:
If you are a developer and want to contribute to our bot's code, we also include [instructions](Running your own libgrabber bot) for running the bot locally.
Please upload only minified files on jsDelivr. Smaller files helps users load websites faster. Minified files also helps us with hosting and promotes good practices. If you need to upload images, see if extra compression can make your images smaller. SVG optimizers may also help with SVG files from Inkscape and Illustrator.
libgrabber looks for
update.json at the root of each project folder. This file tells libgrabber where to check for project updates and which files it should copy to jsDelivr. You add
update.json using these steps:
- Fork the jsDelivr/jsDelivr repo
- Open your project folder. If it doesn't exist, please add a new folder and
info.inifile using jsDelivr's file structure.
update.jsonusing this format:
name (required) - refers to package name on npm or Bower, or repo name when GitHub is used
repo (optional when npm or bower is used) - GitHub repository (for example
files/basePath (optional) - base directory from which files are copied (for example
dist/). Defaults to
/ (relative to the root directory of unpacked project package).
files/include (optional) - array that specifies files and dirs that will be copied from project package. Accepts one or more glob strings. Defaults to
**/*, meaning all files and directories. Useful examples:
main.min.jsfile in the base dir
distdir will be stripped when copied). To retain directory structure prepend glob with
files/exclude (optional) - array that specifies files and dirs that will be excluded. Format is the same as
Bootstrap Example (github)
Following example excludes non-minified resources:
Humane-js (/files/humane.js/update.json) (github)
Lodash Example (npm)
midnight.js Example (single-item include array)
When libgrabber detects a release with a new SemVer compliant tag, it will automatically update the repo on jsDelivr. The
packageManager value you chose in
update.json determines where you need to update your actual package.
It is not required for you to run the bot yourself to update your own project. These instructions are for you to run libgrabber locally for testing.
- Properly configured git account (user.name, user.email, ssh key with empty ssh passphrase)
- Forked jsdelivr repo
- Upstream set to jsdelivr repo
$ git remote add upstream firstname.lastname@example.org:jsdelivr/jsdelivr.git
# --jsdelivr-path <path to the cloned forked repo># --config <path to the above mention config file># --project <name of project to update, if absent libgrabber will default to updating all projects>$ libgrabber --jsdelivr-path jsdelivr/ --config jsdelivr/libgrabber.config.json --project projectName