sami-search

1.0.0 • Public • Published

sami-search

Search any documentation built on Sami

Travis npm version npm downloads npm license

Installation

npm install sami-search --save

Usage

const samiSearch = require('sami-search');
 
samiSearch('https://laravel.com/api/5.3/doc-index.html', 'ServiceProvider')
  .then(results => {
    //=> [
    //=>   {
    //=>     link: 'Illuminate/Support/ServiceProvider.html#method_commands',
    //=>     title: 'Illuminate\\Support\\ServiceProvider',
    //=>     description: 'Method in class ServiceProvider'
    //=>   },
    //=>   {...},
    //=>   {...},
    //=> ]
  })
  .catch(err => {
    result = err;
  });

sami-search will cache the results for 24 hours to avoid requesting and parsing the documentation every time. If you want to request a fresh copy of the docs before 24 hours have passed, you can pass false as a third parameter.

const samiSearch = require('sami-search');
 
samiSearch('https://laravel.com/api/5.3/doc-index.html', 'ServiceProvider', false)

License

MIT © Daniel Eckermann

Readme

Keywords

none

Package Sidebar

Install

npm i sami-search

Weekly Downloads

0

Version

1.0.0

License

MIT

Last publish

Collaborators

  • ecrmnn