jsonstore.io

1.2.1 • Public • Published

Dead: jsonstore.io - Node Library

Travis CI Dependency

A node wrapper library for www.jsonstore.io

jsonstore.io has been shutdown by the creator. If you are looking for an free object store for your projects, check jsonbase.com We have ported the jsonstore.io library with same APIs: npm - jsonbase.com

Links:

Install

npm install --save jsonstore.io

Examples

Make sure to replace the TOKEN in the examples to your own TOKEN, that can be found at https://www.jsonstore.io/.

Eg. https://www.jsonstore.io/<TOKEN>

Write Data

var jsonstore = require('jsonstore.io')
 
// Replace this token with your token.
const TOKEN = '3c9622697a53d8b2f3cf825dc4160f7e1aad46c1a759475edeb76bce5cd33a64'
 
let store = new jsonstore(TOKEN)
 
// Any valid JSON object can be written to given end-point
store.write('Person',{ Name: 'John Doe', Age: 56})
 
// Inner JSON object/Value can be created or modified using URL type path.
store.write('Person/Email','john@demo.com')

Read Data

var jsonstore = require('jsonstore.io')
 
// Replace this token with your token.
const TOKEN = '3c9622697a53d8b2f3cf825dc4160f7e1aad46c1a759475edeb76bce5cd33a64'
 
let store = new jsonstore(TOKEN)
 
// Reading data from any JSON object returns promise.
store.read('Person').then( (data) => {
  console.log(data) // { "Age":56, "Email":"john@demo.com", "Name":"John Doe" }
})
 
// Value of any key can be accessed directly.
store.read('Person/Name').then( (data) => {
  console.log(data) // John Doe
})

Delete Data

var jsonstore = require('jsonstore.io')
 
// Replace this token with your token.
const TOKEN = '3c9622697a53d8b2f3cf825dc4160f7e1aad46c1a759475edeb76bce5cd33a64'
 
let store = new jsonstore(TOKEN)
 
// Pass JSON key to delete.
store.delete('Person/Name')

If you don't pass any key to delete method then all the data would be deleted.
i.e Root node will be deleted.

License

MIT

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i jsonstore.io

    Weekly Downloads

    5

    Version

    1.2.1

    License

    MIT

    Unpacked Size

    6.6 kB

    Total Files

    5

    Last publish

    Collaborators

    • tilak999