Socket
Socket
Sign inDemoInstall

myjson-api

Package Overview
Dependencies
47
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    myjson-api

An SDK for working with myjson.com simple JSON storage service


Version published
Weekly downloads
34
decreased by-48.48%
Maintainers
1
Install size
3.72 MB
Created
Weekly downloads
 

Readme

Source

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-api');

// 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(() => )

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

ParamTypeDescription
binIdstringthe 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

ParamTypeDescription
binIdstringthe id of the bin you want to get the JSON for.
jsonObjectstringthe updated JSON object

Keywords

FAQs

Last updated on 28 Sep 2017

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc