JSPM

  • Created
  • Published
  • Downloads 313400
  • Score
    100M100P100Q210164F
  • License Apache-2.0

Javascript Library for Typesense

Package Exports

  • typesense

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 (typesense) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

typesense-js NPM version CircleCI

Javascript client library for accessing the Typesense HTTP API. Follows the API spec here.

This library can be used both on the server-side and on the client-side. The library's source is in ES6 and during build time, we transpile it to ES5 and generate two artifacts - one that can be used on the server-side and another that uses Browserify and can be used on the client side.

Installation

Install via npm

$ npm install --save typesense

Include the minified JS file for use in the browser directly

<script src="dist/typesense.min.js"></script>

Usage

Read the documentation here: https://typesense.org/api/

Here are some examples that show you how the client works: doc/examples

Tests are also a good place to know how the library works internally: test

Note: When using this library in a browser, please be sure to use an API Key that only allows search operations instead of the master API key.

See doc/examples/server/keys.js for an example on how to generate a search only API key.

Compatibility

Typesense Server typesense-js
>= v0.12.1 >= v0.5.0
>= v0.12.0 >= v0.4.7
<= v0.11 <= v0.3.0

Development

After checking out the repo, run npm install to install dependencies. Then run npm test to run the linter and tests.

To release a new version, we use the np package:

$ npm install --global np
$ np 

# Follow instructions that np shows you

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/typesense/typesense-js.