@armrest/client
v0.2.1
Published
Node.js Armrest client library
Downloads
83
Readme
Armrest Node.js Client Library
A Node.js library for creating an Armrest client api.
Installation
Install using npm
npm install @armrest/client
Get Started
ESM
import Armrest from '@armrest/client'
Create new api
const API = new Armrest('http://armrest-api-url')
.model('Example')
const api = API('api-key')
Creating an Object
const example = await api.Example.create({
test: 'attribute'
})
Updating an Object
await example.update({ test: 'changevalue' })
Selecting Objects
Objects can be selected using any attribute.
const results = await api.select(api.Example).filterBy({ test: 'value' })
Write complex queries using filter
.
const results = api.Example.filter(
pl.or(
pl.Example.test.eq('value'),
pl.Example.test.eq('othervalue')
)
)