🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

babel-plugin-syntax-optional-catch-binding

Package Overview
Dependencies
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-syntax-optional-catch-binding

Allow parsing of optional catch bindings

7.0.0-alpha.16
latest
Source
npm
Version published
Weekly downloads
5K
6.2%
Maintainers
1
Weekly downloads
 
Created
Source

babel-plugin-syntax-optional-catch-binding

This plugin allows Babel to parse optional catch bindings.

Example

Syntax

try {
  throw 0;
} catch {
  doSomethingWhichDoesntCareAboutTheValueThrown();
  console.log("Yay, code executes!");
}

Installation

npm install --save-dev babel-plugin-syntax-optional-catch-binding

Usage

.babelrc

{
  "plugins": ["syntax-optional-catch-binding"]
}

Via CLI

babel --plugins syntax-optional-catch-binding script.js

Via Node API

require("babel-core").transform("code", {
  plugins: ["syntax-optional-catch-binding"]
});

References

  • Proposal: Optional Catch Binding for ECMAScript

Keywords

babel-plugin

FAQs

Package last updated on 25 Jul 2017

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