1.2.0 • Published 3 years ago

@buxlabs/es6-to-amd v1.2.0

Weekly downloads
2
License
MIT
Repository
github
Last release
3 years ago

ES to AMD converter

npm

ES (EcmaScript) Module to AMD (Asynchronous Module Definition) converter

Table of Contents

Background

The import/export syntax is becoming more and more popular. Given a huge, legacy AMD application it's not trivial to migrate it all at once. The converter can help you transpile the modules into the AMD syntax temporarily for backwards compatibility.

Install

npm install @buxlabs/es6-to-amd

Usage

node

Convert a single file with:

const es6toamd = require('@buxlabs/es6-to-amd');
const source = 'export default { hello: 'world' }';
const result = es6toamd(source); // define({ hello: 'world' });

Examples

ES

import Backbone from 'backbone';

export default Backbone.Model.extend({});

AMD

define(['backbone'], function (Backbone) {
    'use strict';
    return Backbone.Model.extend({});
});

There are more examples in the test/fixture directory.

Maintainers

@emilos.

Contributing

All contributions are highly appreciated! Open an issue or submit a PR.

License

MIT © buxlabs

1.2.0

3 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.6.0

5 years ago

0.5.2

6 years ago

0.5.1

7 years ago

0.4.6

7 years ago

0.4.5

7 years ago

0.4.4

7 years ago

0.4.3

7 years ago

0.4.2

7 years ago

0.4.1

7 years ago

0.4.0

7 years ago

0.3.0

7 years ago

0.2.0

7 years ago

0.1.9

7 years ago

0.1.8

7 years ago

0.1.7

7 years ago

0.1.6

7 years ago

0.1.5

7 years ago

0.1.4

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago