@arsonar/client

0.6.11 • Public • Published

@arsonar/client

A JavaScript client for Sonar for browsers and Node.js.

The client talks to @arsonar/server over HTTP.

Usage

npm install @arsonar/client

const { Workspace } = require('@arsonar/client')

or

import { Workspace } from '@arsonar/client'

Example

const { Workspace } = require('@arsonar/client')
const url = 'http://localhost:9191/api/v1/default'
const workspace = new Workspace({ url })

const collection = await workspace.createCollection('foobar')
await collection.put({
  type: 'sonar/entity',
  value: { label: 'hello world' }
})
const records = await collection.query('records', { type: 'sonar/entity' })
console.log(records)

API

See api.md for the API docs.

Readme

Keywords

none

Package Sidebar

Install

npm i @arsonar/client

Weekly Downloads

4

Version

0.6.11

License

GPL-3.0

Unpacked Size

3.63 MB

Total Files

239

Last publish

Collaborators

  • frando