Skip to content

nicolaerusan/myjson

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Overview

This is a simple wrapper for MyJSON.com the simple JSON store for your web or mobile app: http://myjson.com/

It has a Promise based syntax

npm install myjson

Then use it like this:

const myJsonAPI = require('myjson');

// Create a JSON object:
myJsonAPI.create({newBucketName:"New Bucket", counter: 0})
	.then((response) => console.log({id:response.id, uri:response.uri}))
    .error(() => )
    
// Get a JSON object:
myJsonAPI.get({binId})
	.then((json) => console.log(json))
    .error(() => )


// Get a JSON object:
myJsonAPI.update({binId, JSON})
	.then((updatedJSON) => console.log(updatedJSON)
    .error(() => )

You can also try it out here via a Clay function: https://www.clay.run/services/nicoslepicos/my-json-demo

Functions

get(binId)

The get function returns the JSON object associated with the bin id.

create()

The create function creates a new myJSON bin(object). Returns to you the ID of the bin that was

update(binId, jsonObject)

The update function allows you to update the JSON object associated with the bin id.

get(binId) => {JSON}

The get function returns the JSON object associated with the bin id.

Kind: global function

Param Type Description
binId string the id of the bin you want to get the JSON for.

create() => {id, uri}

The create function creates a new myJSON bin(object). Returns to you the ID of the bin that was

Kind: global function Returns: string - binId - the id of the MyJSON bin(object) that was created

update(binId, jsonObject) => {JSON}

The update function allows you to update the JSON object associated with the bin id.

Kind: global function

Param Type Description
binId string the id of the bin you want to get the JSON for.
jsonObject string the updated JSON object

About

A node npm wrapper for myjson.com

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published