npoint

1.0.0 • Public • Published

npoint

NodeJS API for npoint.io

Includes reading/writing to documents.
Creating/Deleting of documents is not supported yet.

Example Usage

let key = 'tKunrUREgDCDiNhV6LiRBD34a' // Bearer Token
let id = '4021841bc3u38302131' // Document ID

let NPoint = require('npoint')

let np = new NPoint(key).Document(id)

await np.get()
// -> { profiles: [ { name: "John", age: 21 } ] }
await np.get('profiles/0/name')
// -> "John"
await np.put('profiles/0/name', 'Jenny')
// -> { profiles: [ { name: "John", age: 21 } ] }
await np.put('profiles/1', { name: 'Josh', age: 45 })
// -> { profiles: [ { name: "Jenny", age: 21 }, { name: "Josh", age: 45 } ] }
await np.delete('profiles/1')
// -> { profiles: [ { name: "Jenny", age: 21 } ] }
await np.delete()
// -> {}

Package Sidebar

Install

npm i npoint

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

3.41 kB

Total Files

3

Last publish

Collaborators

  • bakapear