JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 40
  • Score
    100M100P100Q48249F
  • License ISC

A configurable search interface.

Package Exports

  • isomorphic-search

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (isomorphic-search) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

A configurable, extensible search interface written in ES6.

Fuse is the default search engine, but any search engine can be used if passed via the options object as engine.

const data = [{id: 1, name: 'One'}, {id: 2, name: 'Two'}];

const options: {
  engine: Fuse,
  options: {
    keys: [{ name: 'id', weight: .3 }, { name: 'name', weight: .7 }],
    threshold: .2
  }
};

// Sets abstraction on control, configures search engine, & sets form on view.
Search.constructor(data, options);

To load the script in the browser using the script tag, reference the built UMD script:

<script src="node_modules/isomorphic-search/build/search.js"></script>

To build your own, use Babel or any transpiler of your choice. If you choose Babel, you'll find a standard set-up with a .babelrc and the package.json.

Contribute

npm run build
npm run start