You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

acting

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acting

Tiny Agent Model Tool

2.0.3
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

Acting

Travis npm

Acting is a tiny agent model tool.

Usage

To install acting with yarn:

yarn install acting # or npm install --save acting

Example

import Acting from 'acting';

const acting = new Acting({
  fetch: (...args) => console.log(...args),
  domains: {
    admin: ['GET', 'POST'],
    groups: {
      _self: ['DELETE'],
      role: ['PUT'],
    },
    users: {
      _with: {
        books: ['GET'],
      }
    }
  }
});

await acting.admin.get({ params: { a: 1 } });
await acting.admin.post({ body: { foo: 'bar'} });
await acting.groups.delete({ params: { b: 1 }, body: 'testbody' });
await acting.groups.role.put();
await acting.users(10).books.get();

console.log results:

{ path: '/admin?a=1', method: 'GET' }
{ path: '/admin', method: 'POST' } { foo: 'bar' }
{ path: '/groups?b=1', method: 'DELETE' } 'testbody'
{ path: '/groups/role', method: 'PUT' }
{ path: '/users/10/books', method: 'GET' }

Options

  • root: string
  • domains: object
  • fetch: function
  • selfKey: string(defalt: _self)
  • withKey: string(default: _with)

Keywords

Model

FAQs

Package last updated on 24 Apr 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