Skip to content

Latest commit

 

History

History
73 lines (52 loc) · 2.2 KB

README.md

File metadata and controls

73 lines (52 loc) · 2.2 KB

Skimming
Tag, Customize and Search with Skimming for Deno

Master CI Quality Gate Status deno.land/x/skimming JSR License: MIT


Skimming is a content fetcher for Deno. The idea is to provide a simple and efficient and customizable way to fetch content from the web.

  • Fetch documents online skim() or local with skimContent()
  • Customizable cache
  • Customizable content preview
  • Ignore case option
  • Trim content option to display only complete information
  • Regex support

Usage

No cache

import { Skimming } from "@trackerforce/skimming@[VERSION]"; // or
import { Skimming } from 'https://deno.land/x/skimming@v[VERSION]/mod.ts';

const skimmer = Skimming.create({
  url: "https://raw.githubusercontent.com/petruki/skimming/master/",
  files: ["README.md"],
});

const results = await skimmer.skim("my query");
  • Where previewLength is the number of characters after the found occurrence which will be displayed (default: 200)
  • Add ignoreCase option for whether ignore case or not (default: false)

Using cache

const skimmer = Skimming.create({
  url: "https://raw.githubusercontent.com/petruki/skimming/master/",
  files: ["README.md"],
  cacheOptions: { expireDuration: 10, size: 10 },
});

const results = await skimmer.skim("my query");
  • Where expireDuration the time in seconds that the cached value will expire (default: 1min)
  • Where size is the number of stored queries and its results in cache (default: 60)

Testing

Use deno task test to run tests.

Contributing

Please do open an issue if you have some cool ideas to contribute.