2.2.0 • Published 4 years ago

@kcpaulsen/ish v2.2.0

Weekly downloads
42
License
MIT
Repository
github
Last release
4 years ago

ish

When you need to find a string that's close... ish

Getting Started

npm install -g @kcpaulsen/ish
echo -e "Food\nDrink\nSnacks" | ish 'fod'
  # Food

Multi Matching

You can also provide multiple potential strings to match against. It will match left-to-right, favoring first potential matches over later ones, but fallback if sufficently mismatched

echo -e "Food\nDrink\nSnacks" | ish 'fodd' 'Drink'
  # Food

echo -e "Food\nDrink\nSnacks" | ish 'fdd' 'Dink'
  # Drink

JSON Output (simple and raw-string)

echo -e "Food\nDrink\nSnacks" | ish 'fodd' --json
  # "Food"

echo "Food" | ish 'food' --json-string
  # "\"Food\""

All matches Output

Listing all possible matches, left to right, best to worst.

echo -e "Food\nFodge\nFreak" | ish 'fo' --all --json
  # [ "Food", "Fodge", "Freak" ]

echo -e "Food\nFodge\nFreak" | ish 'fo' --all
  # Food
  # Fodge
  # Freak

Line matching mode

You can also match each line, individually, from a stream of lines. Each line is matched individually against the possible matches, left to right, best to worse.

  echo -e "cat cat kat\nkat kat kat\ndog dog alligator | ish --line 'dog' 'cat'

  # cat
  # kat
  # dog

Supported Options:

  --opts case-sensitive=true threshold=0.5 ...
  • case-sensitive
  • distance
  • threshold
  • tokenize
  • location
  • max-pattern-length
  • min-match-char-length

      echo "FOOD" | ish "food" --opts case-sensitive=true
        #
    
      echo "FOOD" | ish "FOOD" --opts case-sensitive=true
        # FOOD

    For more information on Fusejs options, see:

    https://fusejs.io

About

Heavily leveraging fuse.js (I mean heavy, like most-of-the-real-code), to make cli fuzzy matching, and outputing to other programs like jq, fx, eat, gron, easy and fun.

2.2.0

4 years ago

2.1.0

4 years ago

2.0.0

4 years ago

1.3.5

4 years ago

1.3.3

4 years ago

1.3.2

4 years ago

1.3.1

4 years ago

1.3.0

4 years ago

1.2.0

4 years ago

1.1.9

4 years ago

1.1.8

4 years ago

1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.3

4 years ago

1.0.29

4 years ago

1.0.27

4 years ago

1.0.26

4 years ago

1.0.25

4 years ago

1.0.23

4 years ago

1.0.22

4 years ago

1.0.21

4 years ago

1.0.20

4 years ago

1.0.19

4 years ago

1.0.18

4 years ago

1.0.17

4 years ago

1.0.16

4 years ago

1.0.15

4 years ago

1.0.14

4 years ago

1.0.12

4 years ago

1.0.10

4 years ago

1.0.9

4 years ago

1.0.8

4 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago