@dinoboff/babel-preset-stage-4

2020-02-14

@dinoboff/babel-preset-stage-4

Efficiently applies the minimum of transforms to run stage 4 code on Node.js 4, 6 and 8

build status">@ava/babel-preset-stage-4 Build Status

Babelpreset for use with AVA

Aspires to bring finished ECMAScript proposalsto AVA's test and helper files.

Efficiently applies the minimum of transforms to run the latest JavaScript syntax on Node.js 8, 10 and 12.

Built-ins are not added or extended, so features like Proxies, Array.prototype.includesor String.prototype.padStartwill only be available if the Node.js version running the tests supports it. Consult node.greenfor details.

Sometimes a particular feature is mostlyimplemented in Node.js. In that case transforms are not applied.

Not all proposals can be supported via Babel transforms, see below for details. Babel may require "syntax" plugins in order to parse certain files. These plugins should be applied explicitly since this preset may not include them.

Install

$ npm install --save @ava/babel-preset-stage-4

Usage

Add @ava/stage-4to your Babelpresets.

Options

For more information on setting options for a preset, refer to the preset optionsdocumentation.

modules

By default this preset transform ES2015 modules to CommonJS. Set to falseto disable this behavior. Other values are ignored.

Supported proposals

ProposalSupported
Array.prototype.includesNo
Object.values/Object.entriesNo
String paddingNo
Object.getOwnPropertyDescriptorsNo
Trailing commas in function parameter lists and callsYes
Shared memory and atomicsNo
Lifting template literal restrictionNo
s(dotAll) flag for regular expressionsYes
RegExp named capture groupsNo
RegExp Lookbehind AssertionsNo
RegExp Unicode Property EscapesNo
Promise.prototype.finallyNo
Asynchronous IterationPartially
Optional catchbindingYes
JSON supersetNo
Symbol.prototype.descriptionNo
Function.prototype.toStringrevisionNo
Object.fromEntriesNo
Well-formed JSON.stringifyNo
String.prototype.{trimStart,trimEnd}No
Array.prototype.{flat,flatMap}No
String.prototype.matchAllNo
import()Yes
Promise.allSettledNo

@babel/plugin-proposal-async-generator-functionsrelies on Symbol.asyncIterator, which AVA does not polyfill for you.

以上是 @dinoboff/babel-preset-stage-4 的使用教程帮助文档。

  • @dinoboff/babel-preset-stage-4官网:官网
  • @dinoboff/babel-preset-stage-4源码仓库:源码仓库

上一篇:@dlghq/babel-preset-dialog
下一篇:@ava/babel-preset-stage-4
相关教程
关注微信

扫码加入 JavaScript 社区

相关文章
暂无相关文章

首次访问,需要验证
微信扫码,关注即可
(仅需验证一次)

欢迎加入 JavaScript 社区

号内回复关键字:

回到顶部