Add CLI commands for module docs

This commit is contained in:
James Kyle 2014-11-29 11:31:34 -08:00
parent 063b379d4f
commit 5db757354a

View File

@ -4,7 +4,9 @@
### CLI
$ 6to5 --modules common script.js
```sh
$ 6to5 --modules common script.js
```
### Node
@ -17,13 +19,17 @@ to5.transform('import "foo";', { modules: "common" });
* [AMD](#amd)
* [Common (Default)](#common-default)
* [Common](#common)
* [Common Interop](#common-interop)
* [Ignore](#ignore)
* [System](#system)
* [UMD](#umd)
### Common (Default)
```sh
$ 6to5 --modules common
```
**In**
```javascript
@ -60,6 +66,10 @@ exports.default = test;
### Common interop
```sh
$ 6to5 --modules commonInterop
```
**In**
```javascript
@ -123,6 +133,10 @@ function foo() {
### AMD
```sh
$ 6to5 --modules amd
```
**In**
```javascript
@ -155,6 +169,10 @@ define("filename", ["exports", "foo"], function (exports, _foo) {})
### UMD
```sh
$ 6to5 --modules umd
```
**In**
```javascript
@ -187,6 +205,10 @@ export function bar() {
### Ignore
```sh
$ 6to5 --modules ignore
```
**In**
```javascript
@ -207,6 +229,10 @@ function bar() {
### System
```sh
$ 6to5 --modules system
```
**In**
```javascript
@ -244,7 +270,9 @@ System.register("bar", ["foo"], function (_export) {
You can alternatively specify module names instead of one of the built-in types.
$ 6to5 --modules custom-module-formatter
```sh
$ 6to5 --modules custom-module-formatter
```
**node_modules/custom-module-formatter/index.js**