0.6.11 • Published 2 years ago

@arsonar/client v0.6.11

Weekly downloads
-
License
GPL-3.0
Repository
github
Last release
2 years ago

@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.