Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

apisdk

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

apisdk

APISDK with ES6Module

  • 3.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
increased by300%
Maintainers
1
Weekly downloads
 
Created
Source

API SDK

Usage

const api = new API(root, globalConfig);

api.PATH⁰..PATHⁿ.method(currentConfig);
  • root is the root path of api, default '/'
  • globalConfig is global config for all invokes
  • currentConfig is current config for current invoke
  • PATH⁰..PATHⁿ is request path of api
  • method is one of HTTP methods

  • config is the parameter of fetch api
  • config.credentials is defaultly 'include'

Examples

import API from 'apisdk';

const api = new API('http://127.0.0.1');

/* GET http://127.0.0.1/path1/path2 */
let $result = api.path1.path2.get();
import API from 'apisdk';

const api = new API();

/* POST /path1/path2 HTTP/1.1 */
let $result = api.path1.path2.post({ body: 'a=1&b=2' });

FAQs

Package last updated on 09 Oct 2019

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc