@arsonar/client
v0.6.11
Published
Client for sonar
Downloads
50
Readme
@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.