HTTPS SSH

Relevance-JS: JavaScript / TypeScript development tools and client.

This package is an integration package to use with the backend Relevance services.

This software is still under heavy development, and is available for preview. Contributions are welcome.

Features

Current features

  • Query API
  • Mapping API
  • Service info API

Upcoming features

  • HTML template integration

Installation

Simply install using npm:

$ npm install relevance-js

Node.js

You can import the whole package or just the bits you want:

var relevance = require('relevance-js');
var service = new relevance.search.SearchService(url);

var SearchService = require('relevance-js/search').SearchService;
var service = new SearchService(url);

TypeScript

This package is actually created in TypeScript, and so is fully compatible:

import { SearchService } from 'relevance-js/search';

Browser

It is also bundled into a working browser library with browserify:

<script type="text/javascript" src="node_modules/relevance-js/bundle.js"></script>
<script type="text/javascript">
    var service = new relevance.search.SearchService(url);
</script>

Usage

All async endpoints use ES6 promises:

var service = new SearchService(url);
var engine = service.getEngine('myEngine');

engine
    .search('"term" with slice(10, 10)')
    .then((response) => {
        console.log(response.results);
    })
    .catch((err) => {
        console.log(err);
    });

Building

When building from source, use the build script:

$ npm run build

It creates a distribution in the dist/ directory, and documentations in build/docs/.

Contributing

Contributions are always welcome. If you want to contribute:

  • Fork the project
  • Test your code (see below)
  • Push your code
  • Submit a pull request

Testing

Contributions must pass both the tests and styling guidelines. Before submitting a patch, make sure you run:

$ npm run test && npm run validate

About the project

Change log

See CHANGELOG https://bitbucket.org/overridelogic/relevance-js/raw/master/CHANGELOG.md.

Licence

MIT License: see LICENSE https://bitbucket.org/overridelogic/relevance-js/raw/master/LICENSE.

Authors

Francis Lacroix @netcoder1 created Relevance while at OverrideLogic.