# @isdenmois/amd-to-es6

> convert amd to es6

Latest version **0.11.2** (published 2017-12-20) · MIT license · 0 weekly downloads

## Install

```sh
npm install @isdenmois/amd-to-es6
pnpm add @isdenmois/amd-to-es6
yarn add @isdenmois/amd-to-es6
bun add @isdenmois/amd-to-es6
```

Provides the command `amdtoes6`.

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.11.2 |
| Published | 2017-12-20 |
| First published | 2017-12-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >=8.9.1 |
| Dependencies | 6 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | emil@ajdyna.com |
| Maintainers | isdenmois |
| Keywords | amd, es6, converter |

## Links

- npm: https://www.npmjs.com/package/@isdenmois/amd-to-es6
- Repository: https://github.com/isdenmois/amd-to-es6
- Homepage: https://github.com/isdenmois/amd-to-es6#readme
- Issues: https://github.com/isdenmois/amd-to-es6/issues
- npm.io page: https://npm.io/package/@isdenmois/amd-to-es6

## Dependencies (6)

- [glob](https://npm.io/package/glob.md) 7.1.1
- [acorn](https://npm.io/package/acorn.md) 5.2.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1
- [commander](https://npm.io/package/commander.md) 2.12.2
- [@buxlabs/ast](https://npm.io/package/@buxlabs/ast.md) ^0.9.0
- [underscore.string](https://npm.io/package/underscore.string.md) 3.3.4

## Alternatives

- [@mdxeditor/editor](https://npm.io/package/@mdxeditor/editor.md) — 962.4K weekly downloads
- [mmdb-lib](https://npm.io/package/mmdb-lib.md) — 680.9K weekly downloads
- [playcanvas](https://npm.io/package/playcanvas.md) — 36.2K weekly downloads
- [@glw907/cairn-cms](https://npm.io/package/@glw907/cairn-cms.md) — 967 weekly downloads
- [markdown-to-confluence](https://npm.io/package/markdown-to-confluence.md) — 103 weekly downloads

## Recent versions

- 0.11.2 (latest) — 2017-12-20

## README

# AMD to ES6 converter

[![Codeship](https://img.shields.io/codeship/f6299130-6721-0134-f3f9-02d00f1d3243/master.svg)](https://app.codeship.com/projects/176125)

## Installation

`npm install @isdenmois/amd-to-es6`

If you'd like to use it in the cli consider installing globally or use `npx`

`npm install -g @isdenmois/amd-to-es6`

## Usage

### cli

Convert a single file with:

`amdtoes6 app.js > app-es6.js`

Convert multiple files in given dir with:

`amdtoes6 --src=src --dest=build`

Convert multiple files in given dir recursively with:

`amdtoes6 --src=src --dest=build --glob=**/*.js`

Convert multiple files and replace them with:

`amdtoes6 --src=src --replace`

### node

Convert a single file with:

```javascript
const amdtoes6 = require('@isdenmois/amd-to-es6');
const source = 'define({ hello: 'world' });';
const result = amdtoes6(source); // export default { hello: 'world' };
```

## Examples:

**AMD**

```javascript
define([
    'core/view',
    'subapp/hello/template/layout'
], function (View, template) {
    'use strict';

    return View.extend({
        template: template
    });

});
```

**ES6**

```javascript
import View from 'core/view';
import template from 'subapp/hello/template/layout';

export default View.extend({
    template: template
});
```

**AMD**

```javascript
define(function (require) {
    'use strict';

    var Marionette = require('marionette');

    return Marionette.Object.extend({
        initialize: function () {
            console.log('hello world');
        }
    });
});
```

**ES6**

```javascript
import Marionette from 'marionette';

export default Marionette.Object.extend({
    initialize: function () {
        console.log('hello world');
    }
});
```

There are more examples in the test/fixture directory

### Options
```sh

  Usage: amdtoes6 [options]

  Options:

    -s, --src <dirname>     Directory of the source files
    -d, --dest <dirname>    Directory of the destination files
    -g, --glob [glob]       Glob pattern for the src to match for input files
    -r, --recursive         Set glob pattern to **/*.js with no hassle
    -b, --beautify          Beautify the output
    --replace           Replace the input files with results
    --suffix <string>   Replace suffix of the files
    --side              Import side effects with camel cased named
    --assigned          Automatically assign custom name to side effects
    --quotes            Single, double or auto quotes in the output
    --comments          Basic comments, copy them to the top of the output file

```

## Inspired by:

https://github.com/jonbretman/amd-to-as6

---
_Source: https://npm.io/package/@isdenmois/amd-to-es6 · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
