forrer

0.1.2 • Public • Published

forrer

CLI/Node program for safe (based of AST tree) transforming "forEach" methods into "for" cycles.

Usage:

Bash:

forrer source.js > processed.js

Node.js:

var forrer = require('./src/forrer');

var code = 'arr.forEach(function(a) { console.log(a); });'

console.log(forrer(code));

Transformation look like this:

arr.forEach(function(a) { console.log(a); });
for(var _i=0,a,_m=arr;_i<_m.length;++_i){a=_m[_i]; console.log(a); }

Package Sidebar

Install

npm i forrer

Weekly Downloads

4

Version

0.1.2

License

GPL v2

Last publish

Collaborators

  • bacher