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

babel-plugin-get-rid-of-async-await

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-get-rid-of-async-await

Get-rid-of-async-await

  • 0.0.4
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
9
increased by800%
Maintainers
1
Weekly downloads
 
Created
Source

babel/transform-get-rid-of-async-await

Turn async functions into non-async functions.

Why would you ever do that? I'm building a generic testing wrapper that allows me to reuse the same pageobjects for enzyme/chimp/cypress.io/webdriverio. The idea is that in tests I only use page objects, and the underlying implementation of them is hidden from a user. Unfortunately, some of the API - like cypress.io or chimp 1.0 or not async/await compatible, while for enzyme it's a must. This way I can use the same code in both, by using different BABEL_ENV.

Example

In

async function foo() {
  await bar();
}

Out

function foo() {
  bar();
}

Installation

npm install --save-dev babel-plugin-get-rid-of-async-await

Usage

.babelrc

Without options:

{
  "plugins": ["babel/transform-get-rid-of-async-await"]
}

Via CLI

babel --plugins babel/transform-get-rid-of-async-await

Via Node API

require("babel/core").transform("code", {
  plugins: ["babel/transform-get-rid-of-async-await"]
});

Keywords

FAQs

Package last updated on 06 Jan 2018

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