Skip to main content

@babel/plugin-syntax-explicit-resource-management

note

Syntax only

It's unlikely you want to use this plugin directly as it only enables Babel to parse this syntax. Instead, use plugin-transform-explicit-resource-management to both parse and transform this syntax.

History
VersionChanges
v7.22.0Supports await using

This plugin enables Babel to parse using declarations:

JavaScript
using handler = await read();
await using handler = await read();

Installation

npm install --save-dev @babel/plugin-syntax-explicit-resource-management

Usage

babel.config.json
{
"plugins": ["@babel/plugin-syntax-explicit-resource-management"]
}

Via CLI

Shell
babel --plugins @babel/plugin-syntax-explicit-resource-management script.js

Via Node API

JavaScript
require("@babel/core").transformSync("code", {
plugins: ["@babel/plugin-syntax-explicit-resource-management"]
});

Reference

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy