/whirli-client

Whirli Client

Primary LanguageTypeScript

Whirli Javascript Client

The Whirli Javascript Client provides convenient access to the Whirli API from applications written in javascript.

Documentation

See the Whirli API docs.

Installation

Install the package with:

yarn add whirli-client

Usage

The client requires a Http Client (such as axios) to be passed in to the constructor. It will then use this client for all requests.

Simply import the Client and passed it the Http Client, and you're good to go:

import axios from 'axios';
import Client from 'whirli-client';

...

const api = new Client(axios);
const all = api.search.all();

Usage with Typescript

Types are included with this package.

import axios from 'axios';
import Client from 'whirli-client';

...

const api: Client = new Client(axios);

Usage with Nuxt

Simply import the Client into a plugin file, and then inject it as you need it:

import Client from 'whirli-client';

export default function ( { app: { $axios } ) {
   inject('whirli', Client($axios));
}

Development

Linting

yarn lint

Type checking

yarn type-check
yarn type-check:watch

Build

yarn build

Publishing

  • Checkout develop
  • Check package.json to see what the next release name will be (e.g. 0.0.10 means next is 0.0.11)
  • Alter the CHANGELOG with the new release name and date, inserting it just below 'Unreleased'.
  • Commit on to the develop branch
  • Run yarn release
  • PR to master