{"id":13567701,"url":"https://github.com/matthewbednarski/cdnjs-client","last_synced_at":"2026-01-22T06:07:18.291Z","repository":{"id":72735932,"uuid":"43801311","full_name":"matthewbednarski/cdnjs-client","owner":"matthewbednarski","description":"a client for cdnjs's api and for GET'able resources. ","archived":false,"fork":false,"pushed_at":"2016-07-15T08:22:45.000Z","size":116,"stargazers_count":5,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2024-11-04T22:37:33.580Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/matthewbednarski.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2015-10-07T07:37:54.000Z","updated_at":"2021-04-12T06:01:51.000Z","dependencies_parsed_at":null,"dependency_job_id":"1ab5b544-7f95-4cad-ac95-fbf18a34eaa6","html_url":"https://github.com/matthewbednarski/cdnjs-client","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbednarski%2Fcdnjs-client","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbednarski%2Fcdnjs-client/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbednarski%2Fcdnjs-client/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/matthewbednarski%2Fcdnjs-client/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/matthewbednarski","download_url":"https://codeload.github.com/matthewbednarski/cdnjs-client/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247111139,"owners_count":20885389,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-01T13:02:39.750Z","updated_at":"2026-01-22T06:07:18.262Z","avatar_url":"https://github.com/matthewbednarski.png","language":"Shell","funding_links":[],"categories":["Shell"],"sub_categories":[],"readme":"\n# Cdnjs Client\n\n**cdnjs** is a substitute for [bower](http://bower.io/)/npm in a [node](https://nodejs.org/en/) free environment. It depends on [bash](https://www.gnu.org/software/bash/), [jq](https://stedolan.github.io/jq/) and [curl](http://curl.haxx.se/).\n\nIt is mainly a client for [cdnjs](https://cdnjs.com/)/[cdnjs API](https://github.com/cdnjs/cdnjs#api) but it can handle any `GET`'able, publicly-available resources; [gists](https://gist.github.com) in particular . \n\n\n## Commands\n\n### Usage\n\nTo print the script's usage:\n\n```sh\n$ cdnjs --help\n```\nWhich gives the following output:\n\n```\n$ cdnjs --help\nUsage: cdnjs [OPTIONS] [ARGS]:\n\n    Options:\n    --init, init                     initialize a config file\n    --conf [CONFIG FILE]             use a custom config file\n    --list, list   [/to/exclude]     prints a list of link and script tags\n    --index, index [/to/exclude]     same as \"--list\"\n    --html, html   [/to/exclude]     same as \"--list\"\n\n    --nodev, nodev                   excludes non '.min.*' files; a flag for \\\"--list\\\"\n    --dev, dev                       excludes '.min.*' files; a flag for \\\"--list\\\"\n\n    -f, --find, find [ARGS]          perform query on api.cdnjs.com\n        --search, search [ARGS]      same as \"--search [ARGS]\"\n    -c, --clean, clean [ARGS]        clean configured relative-location\n    -s, --sync, sync [ARGS]          asynchronously download configured resources\n        --update, update [ARGS]      same as \"--sync [ARGS]\"\n    -a, + [LIB[+VERSION]] [GROUP]    add library with optional version to optional\n        --add, add                    group\n    -i, --install, install [LIB]     same as \"add\" plus \"sync\"\n    -d, --delete, delete [LIB]       removes library from configuration\n    --remove, remove [LIB]           same as \"delete\"\n\n    -v, --verbose, verbose           print debug/verbose output\n        --debug, debug               same as \"--verbose\"\n        --nocolor, nocolor           don't echo in color, useful for logging stdout/stderr\n    -h, -?, --help, help             print usage\n```\n\n\n### Init\n\nTo initialize a cdnjs configuration file at the default location `$(pwd)/.cdnjs`:\n\n```sh\n$ cdnjs init\n```\n\nTo specify another location to initialize:\n\n```sh\n$ cdnjs --conf .another-cdnjs.conf init\n```\n\nTo initialize a non-default configuration file in another directory: \n\n```sh\n$ cdnjs --conf ~/dir/to/create/.cdnjs init\n```\nNB. if the `path` of the file doesn't exist the script will attempt to create it.\n\n\n### Search/Find\n\nRequires a parameter `\"search string\"`.\n\nTo search for libraries containing `jquery`:\n\n```sh\n$ cdnjs search jquery\n```\n\n### Add\n\nThis command requires a parameter `library` with an optional suffix `+version`.\n\nTo add the latest version of `jquery` to your configuration:\n\n```sh\n$ cdnjs add jquery\n```\nTo add a specific version of `jquery` to your configuration use the syntax `library[+version]`\n\n```sh\n$ cdnjs add jquery+1.9.0\n```\n\n### Clean\n\nTo clean all the paths indicated by the configuration's `relative-location`:\n\n```sh\n$ cdnjs clean\n```\n\n### Sync/Update\n\nTo download the resources indicated by the current configuration:\n\n```sh\n$ cdnjs sync \n```\nNB. the resources will be downloaded to a *tmp* directory and then moved to the configuration's `relative-location`'s.\n\n### Install\n\nPerforms the `--add` and `--sync` commands:\n\n```sh\n$ cdnjs install jquery\n# \n# same as\n# \n$ cdnjs sync add jquery\n```\n\n### Delete/Remove\n\nRemoves the indicated library from the configuration and filesystem:\n\n```sh\n$ cdnjs remove jquery\n#\n# or\n# \n$ cdnjs --delete jquery\n```\n\n## Flags\n\nThere are a few *flags* for modifying output or functionality.\n\nSome are *general* and can be used with any command, such as `--conf`, `--debug` or `--nocolor`.\n\nOthers can be used only with *specific* commands, such as the `list` command's `--dev` and `--nodev` flags.\n\n### Conf\n\nAny command that requires the use of a configuration file can use the *flag* `--conf` to indicate an alternate file.\n\nThe commands which require a configuration file are `--init`, `--add`, `--clean` and `--sync`.\n\nThe default configuration file, if `--conf` is not specified, is `.cdnjs` in the current working directory.\n\nTo initialize a non-default configuration file in the current working directory:\n\n```sh\n$ cdnjs --conf .another-cdnjs.conf init\n```\n\nTo add `jquery` version `2.1.4` to a non-default configuration:\n\n```sh\n$ cdnjs --conf .another-cdnjs.conf --add jquery+2.1.4\n```\n\n### Debug/Verbose\n\nTo output `debug` messages add the `-v` flag to any command:\n\n```sh\n$ cdnjs sync -v\n# or\n$ cdnjs clean --verbose\n# or\n$ cdnjs clean --debug\n# or\n$ cdnjs clean verbose\n# or\n$ cdnjs clean debug\n```\n\n### No Color\n\nTo not output *color* escape codes add the `nocolor` flag.  This is helpful when you want to log `stdout/stderr` to file.\n\n```sh\n$cdnjs sync nocolor\n```\n\n\n### Dev\n\nA flag for the `--list` command, it excludes any `min.js` or `min.css` from its output.\n\n```sh\n$ cdnjs list --dev\n```\n\n### No-Dev\n\nA flag for the `--list` command, it excludes any library not ending in `min.js` or `min.css` from its output.\n\n```sh\n$ cdnjs list --nodev\n# or\n$ cdnjs list nodev\n```\n\n\n## Configuration example:\n\nAn example configuration file is found in this repository at [example/.cdnjs](https://raw.githubusercontent.com/matthewbednarski/cdnjs-client/master/example/.cdnjs).\n\nA file `.cdnjs` in the `pwd` or passed to the program through the `--conf [conf-file]` option.\n\n## Setup\n\n`cdnjs` depends on `bash`, `jq`, `curl` and `mktemp`.  If those dependencies are met and and `cdnjs` is on your `$PATH` everything should be fine.\n\n\n## Windows Setup\n\nSince `cdnjs` is a `bash` script it will work in a bash environment such as [Git for Windows](https://git-for-windows.github.io/), however it requires `jq` and `mktemp` ( not found in `Git for Windows` pre version `1.9.5`).\n\n### Download Jq\n\n[Download the `jq` binary](https://stedolan.github.io/jq/download/) and rename it to `jq.exe`. Place it in a folder known to be on your `$PATH`, eg. if you are using `Git for Windows` version `2.6.1` you will have `%PROGRAMFILES%\\Git\\usr\\bin` in which you can place the `jq.exe` binary.\n\n### Download cdnjs\n\nDownload the [latest version of cdnjs](https://raw.githubusercontent.com/matthewbednarski/cdnjs/master/cdnjs). Save it to a folder on you `$PATH` and make it executable.\n\n### Windows Setup Example Steps:\n\n1. Edit `.bashrc`:\n\n```sh\n...\nif [ -d \"~/bin\" ]; then\n  export PATH=$PATH:~/bin\nfi\n...\n```\n\n2. Then perform the following commands:\n\n```sh\nif [ ! -d \"~/bin\" ]; then mkdir \"~/bin\"; fi\ncd ~/bin\nwget https://raw.githubusercontent.com/matthewbednarski/cdnjs/master/cdnjs\nchmod +x cdnjs\nwget https://github.com/stedolan/jq/releases/download/jq-1.5/jq-win64.exe\nmv jq-win64.exe jq.exe\nchmod +x jq.exe\nls -al\n```\n\n## Todo\n\n + allow partial `clean`'s and `sync`'s by section key (ie `cdnjs` or `gists` )\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewbednarski%2Fcdnjs-client","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmatthewbednarski%2Fcdnjs-client","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmatthewbednarski%2Fcdnjs-client/lists"}