Refactor move docs (#8108)

* feat: [skip] generate readme script

* docs: [skip ci] update READMEs

* docs: [skip ci] fix code block type

* chore: [skip ci] move generator script
This commit is contained in:
Sven SAULEAU
2018-06-04 16:32:39 +02:00
committed by Henry Zhu
parent b6eaaa2496
commit b445b79734
143 changed files with 1286 additions and 11238 deletions

View File

@@ -1,52 +1,19 @@
# @babel/plugin-syntax-optional-catch-binding
> This plugin allows Babel to parse optional catch bindings.
> Allow parsing of optional catch bindings
## Example
See our website [@babel/plugin-syntax-optional-catch-binding](https://new.babeljs.io/docs/en/next/babel-plugin-syntax-optional-catch-binding.html) for more information.
**Syntax**
## Install
```javascript
try {
throw 0;
} catch {
doSomethingWhichDoesntCareAboutTheValueThrown();
console.log("Yay, code executes!");
}
```
## Installation
Using npm:
```sh
npm install --save-dev @babel/plugin-syntax-optional-catch-binding
npm install --save @babel/plugin-syntax-optional-catch-binding
```
## Usage
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["@babel/plugin-syntax-optional-catch-binding"]
}
```
### Via CLI
or using yarn:
```sh
babel --plugins @babel/plugin-syntax-optional-catch-binding script.js
yarn add --save @babel/plugin-syntax-optional-catch-binding
```
### Via Node API
```javascript
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-syntax-optional-catch-binding"]
});
```
## References
* [Proposal: Optional Catch Binding for ECMAScript](https://github.com/babel/proposals/issues/7)