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

babel-preset-modern-async

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-preset-modern-async

Cutting edge Babel preset using 'fast-async' instead of generators for async/await. Also configurable for Electron.

  • 1.0.0-alpha.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
4
Maintainers
1
Weekly downloads
 
Created
Source

babel-preset-modern-async

Semi-opinionated preset for Babel based on babel-preset-latest but using fast-async for async/await transpilation instead of generators. Also includes configuration options for using Bluebird as the Promise library, targeting Electron, and setting a stage ( ie. stage-0 )

Install

npm i babel-preset-modern-async

Usage

Minimum configuration:

{
  "presets": ["modern-async"]
}

You can also pass in a configuration object ( configuration intensifies ):

{
  "presets": [["modern-async", {
    "fast-async": {
      "env": {
        "augmentObject": false,
        "dontMapStackTraces": true,
        "dontInstallRequireHook": true
      },
      "compiler": {
        "promises": true,
        "generators": false
      },
      "runtimePattern": "directive",
      "useRuntimeModule": false
    },
    "electron": false,
    "promise": "bluebird",
    "stage": 0
  }]]
}

The above are the default options, the bulk of which come from fast-async. The rest:

  • electron

    When set to true, many plugins will be excluded that the Electron environment natively supports. Similar to the babel-preset-electron preset.

  • promise

    Determines the Promise implementation, which is left native (or whatever you use at runtime) when this option is anything but 'bluebird' (currently the only option with any affect). When set to 'bluebird', the bluebird library is automatically inserted and all Promise references use it without further configuration.

    NOTE: The bluebird library is not a dependency of this preset. If you intend to use this option, you must install it yourself.

  • stage

    A number representing the ES feature stage to use in addition to the latest preset. These correspond to the Babel -stage-* presets.

More advanced configuration notes are in progress.

License

MIT © Bo Lingen / citycide

See LICENSE

Keywords

FAQs

Package last updated on 06 Nov 2016

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