README
sami-search
Search any documentation built on Sami
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