Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Search a JSON document by path, content, and inferred content

License

NotificationsYou must be signed in to change notification settings

triggerdotdev/fuzzy-json-search

VSCode style fuzzy search for JSON documents

🚀 Features

  • Use VSCode style fuzzy search on a JSON document
  • Searches through key names, path, raw values and formatted values

💻 Usage

Install Fuzzy JSON Search

$ npm install --save @jsonhero/fuzzy-json-search

The simplest way to search is to create an instance ofJSONHeroSearch and pass it a JSON object:

constresponse=awaitfetch("https://jsonplaceholder.typicode.com/todos");constjson=awaitresponse.json();constsearcher=newJSONHeroSearch(json);constresults=searcher.search("user");

API

JSONHeroSearch.search(query: string)

Performs a fuzzy search against the entire document, ordering by score. Will only return results that score more than 0.

ReturnsArray<SearchResult<string>>>

SearchResult<string> has the following properties:

item is astring representing the path to the key
score is anItemScore
ItemScore has the following properties
score is a number, the higher the score the better a match
labelMatch is an array ofMatch objects
descriptionMatch is an array ofMatch objects
rawValueMatch is an array ofMatch objects
formattedValueMatch is an array ofMatch objects
Match is type{ start: number; end: number }

About

Search a JSON document by path, content, and inferred content

Resources

License

Code of conduct

Contributing

Stars

Watchers

Forks

Packages

No packages published

Contributors3

  •  
  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp