sitelock-holmes

Simple, pure-javascript site search for Node.JS

Usage no npm install needed!

<script type="module">
  import sitelockHolmes from 'https://cdn.skypack.dev/sitelock-holmes';
</script>

README

Sitelock Holmes.js

npm version Build Status

Sitelock Holmes.js is a simple, easy to use both browser and Node.JS module for implementing a pure javascript site search for your page.

Latest Release: v1.2.0 Watson

Example:

Server

var ss = require('sitelock-holmes');
var sitesearch = new ss(['http://facekapow.github.io','http://facekapow.github.io/sitelock-holmes.js/']);
sitesearch.search('under');
sitesearch.on('results',function(results) {
  //Returns array of result array, one per page.
  for (var i = 0; i < results.length; i++) {
  var result = results[i];
    //Now we have an array of results, let's iterate it:
    for (var j = 0; j < result.length; j++) {
      var currentResult = result[j];
      console.log(currentResult);
    }
  }
});