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

arrested

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arrested

interface for crud api calls to restful services

  • 0.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-80%
Maintainers
1
Weekly downloads
 
Created
Source

arrested

interface for crud api calls to restful services

givit is the request engine. It is built ontop of hyperquest. Check them out for the request callback

var arrested = require("arrested");

var config = {
  //api url
  url: "http://0.0.0.0:8080",
  //name of collection
  collection: "members"
};

// create new interface
var members = arrested(config);

members.create({id: 1234, name: "Tarquin"}, function (e, r) {

  console.log("created a new member!");
});

api

create
var newMember = {
  name: "Jacques",
  id: 298
};
// sends POST url/members with newMember as request body
members.create(newMember, function (e, r) {

  ...
});
find
var member = {
  name: "Jacques",
  id: 298
};
// sends GET url/members?name=Jacques&id=298
members.find(member, function (e, r) {

  ...
});
findOne
var member = {
  name: "Jacques",
  id: 298
};
// sends GET url/members/298
members.findOne(member, function (e, r) {

  ...
});
update
var member = {
  name: "Jacques",
  id: 298
};
var changes = {
  name: "Leibniz"
};
// sends PUT url/members/298 with changes is request body
members.update(member, changes, function (e, r) {

  ...
});
delete
var member = {
  name: "Jacques",
  id: 298
};
// sends DELETE url/members/298
members.del(member, function (e, r) {

  ...
});

Keywords

FAQs

Package last updated on 04 May 2015

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