@chialab/estransform

Execute multiple transformations on JavaScript sources with full sourcemaps support.

Usage no npm install needed!

<script type="module">
  import chialabEstransform from 'https://cdn.skypack.dev/@chialab/estransform';
</script>

README

Estransform • Execute multiple transformations on JavaScript sources with full sourcemaps support.

NPM


Install

$ npm i @chialab/estransform -D
$ yarn add @chialab/estransform -D

Usage

import { transform } from '@chialab/estransform';

const { code, map } = await transform('require("tslib"); module.exports = function() {}', { sourceContents: true }, (magicCode, contents) => {
    magicCode.overwrite(
        0,
        contents.length,
        'Hello!'
    );
});

License

Estransform is released under the MIT license.