JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 20
  • Score
    100M100P100Q49194F
  • 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

Isomorphic Search

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.

jQuery is an external dependency, though that will change soon enough.

Load Search in Browser
To use the script tag, reference the built script:

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

There's also a UMD build accessible through build/search.js.

To build your own, you may benefit from reviewing .babelrc and/or webpack.config.js, along with the obvious, package.json.

Example

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

// Only the `options.engine` property must absolutely be set.
// See src/agent/abstraction for defaults.
const options: {
  // Any search engine will do.  See `control.engine`.
  engine: Fuse,
  // A selector identifying the element to contain the search module form.
  parent: 'header',
  // These are the options passed to the search engine: (data, options) => {}
  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);

Contribute

npm run build

@TODO

[x] Browser-facing
[ ] Server-facing