cse
v1.0.4
Published
Google custom search engine snippet
Downloads
8
Readme
cse
Use Google custom search engine on your page.
See in the wild on the American Scenic Byways website - source.
Installation
Install with npm:
$ npm install cse
API
You need to create custom search engine and obtain search engine ID whithc looks like this:
012345678901234567890:abcdefghijk
Add #cseSearchBox
or #cseSearchResults
(or both) to your HTML and then initialize them with
google's magic.
var cseID = "012345678901234567890:abcdefghijk";
require('cse')(cseID);
If neither #cseSearchBox
nor #cseSearchResults
are found we die silently without trying to load
any scripts from google.
License
MIT