Socket
Socket
Sign inDemoInstall

babel-plugin-isotropy-rpc

Package Overview
Dependencies
6
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    babel-plugin-isotropy-rpc

Babel plugin for transpiling to isotropy-lib-rpc


Version published
Weekly downloads
1
Maintainers
1
Created
Weekly downloads
 

Readme

Source

Isotropy Babel Plugin for RPC

This module is a babel plugin that transpiles function calls from the designated server module(s) into corresponding server calls.

It uses isotropy-ast-analyzer-rpc for AST analysis.

This is part of the isotropy framework (www.isotropy.org).

Usage

Create a module "server.js" containing a set of exported function that mock the server. The filename can be changed in configuration.

//In my-server/index.js
export function getAllTodos() {
  return todos
}

Perform a RPC

import * as myServer from "../my-server";

async function getAllTodos() {
  return await myServer.postsAPI.getAllTodos();
}

Configuration

In .babelrc include

plugins: ["transform-to-isotropy-rpc",
  {
    projects:
      [
        {
          dir: "src",
          modules: [{ source: "server/my-server", url: "https://www.example.com" }]
        }
      ]
  }
]

Specify the filesystem directory in which your project lies and include the module's path and the url it translates to.

FAQs

Last updated on 17 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