188c88e8eSopenharmony_ci# Weex `<script>` Transformer 288c88e8eSopenharmony_ci 388c88e8eSopenharmony_ci[![NPM version][npm-image]][npm-url] 488c88e8eSopenharmony_ci[![Build status][circle-image]][circle-url] 588c88e8eSopenharmony_ci[![Downloads][downloads-image]][downloads-url] 688c88e8eSopenharmony_ci 788c88e8eSopenharmony_ci[npm-image]: https://img.shields.io/npm/v/weex-scripter.svg?style=flat-square 888c88e8eSopenharmony_ci[npm-url]: https://npmjs.org/package/weex-scripter 988c88e8eSopenharmony_ci[circle-image]: https://circleci.com/gh/weexteam/weex-scripter.svg?style=svg 1088c88e8eSopenharmony_ci[circle-url]: https://circleci.com/gh/weexteam/weex-scripter/tree/master 1188c88e8eSopenharmony_ci[downloads-image]: https://img.shields.io/npm/dm/weex-scripter.svg?style=flat-square 1288c88e8eSopenharmony_ci[downloads-url]: https://npmjs.org/package/weex-scripter 1388c88e8eSopenharmony_ci 1488c88e8eSopenharmony_citransform JavaScript 1588c88e8eSopenharmony_ci 1688c88e8eSopenharmony_ci## API 1788c88e8eSopenharmony_ci 1888c88e8eSopenharmony_ci- `fix(code)`: automatically add `data: {function () {return {...}}}` to init component data from `data: {...}` 1988c88e8eSopenharmony_ci- `parseAndReplaceRequire(code)`: parse third party js required in `<script>`, return the modified code and collect requires 2088c88e8eSopenharmony_ci * note that `require` is automatically changed to `browserifyRequire` because of the built-in `require` in `js-framework` 2188c88e8eSopenharmony_ci- `getBundle(requires)`: bundle all the third party js required in `<script>` by using `browserify` 22