#command-line #fuzzy-finder #com #caniuse #alfred-workflow #search-query #client

app caniuse-rs

A command line client for caniuse.com, written in Rust

18 unstable releases (3 breaking)

0.4.1 Dec 1, 2021
0.4.0 Dec 1, 2021
0.3.1 Nov 30, 2021
0.2.1 Nov 28, 2021
0.1.11 Nov 26, 2021

#197 in Caching

Download history 7/week @ 2024-03-29 3/week @ 2024-04-05

56 downloads per month

MIT license

1.5MB
470 lines

caniuse-rs

A Rust client for caniuse.com.

demo

It pulls data from caniuse.com and caches it locally, in a transformed JSON structure that is easier to reason about. It will update data on next run after 24 hours since last update. Fuzzy finder is built using skim.

Install

Via Cargo

If you have a Rust toolchain installed, you can install by running cargo install caniuse-rs. The installed binary is named caniuse.

Prebuilt Binaries

Prebulit binaries are available from the latest GitHub release. Download the binary for your platform, rename it to caniuse, and put it somewhere on your $PATH. Then, you will need to make it executable by running chmod +x path/to/caniuse. When installing this way on MacOS, after attempting to run for the first time, you will need to open MacOS System Preferences -> Security & Privacy -> General tab, then click "Allow Anyway" to allow the caniuse executable to run.

Alfred Workflow

You can use this as an Alfred workflow on MacOS by downloading the *.alfredworkflow file for your platform (caniuse-macos-x86.alfredworkflow for Intel Macs, caniuse-macos-arm.alfredworkflow for M1 macs) from the latest GitHub release and double-clicking the file from Finder once downloaded. After attempting to run for the first time, you will need to open MacOS System Preferences -> Security & Privacy -> General tab, then click "Allow Anyway" to allow the caniuse executable to run.

Usage

Run caniuse by itself to open the fuzzy finder, then enter a search query to fuzzy find what you're looking for. Pressing enter will open the selected item. If no items match, pressing enter will search for the query you've typed by opening https://caniuse.com/?search={query}.

Options

USAGE:
    caniuse [FLAGS] [OPTIONS]

FLAGS:
        --alfred     Transform JSON structure for use in Alfred workflow. See:
                     https://www.alfredapp.com/help/workflows/inputs/script-filter/json/
    -d, --dump       Print currently cached data and exit instead of using fuzzy-finder
    -h, --help       Prints help information
    -p, --pretty     Pretty-print JSON output, must be combined with --dump or --query option
    -u, --update     Force-update cached data before querying
    -v, --version    Print the version and exit

OPTIONS:
    -q, --query <query>    Run a query and output the JSON results instead of using the fuzzy-finder

Dependencies

~15–28MB
~464K SLoC