0.0.1 • Published 8 years ago

reshift v0.0.1

Weekly downloads
4
License
MIT
Repository
github
Last release
8 years ago

Reshift.js - rewrite an abstract syntax tree

Reshift.js lets you reshift and rewrite an abstract syntax tree on a recursive walk, returning the re-written source code.

Example

Uppercase string literals:

var reshift = require('reshift');

var content = [
  'console.log(\'hello world\')',
].join('\n');

var output = reshift(content, function(node) {
  if (node.type == 'Literal') {
    return node.raw.toUpperCase();
  }

  return node.toString();
});

console.log(output);

Install

npm install reshift

License

MIT

0.0.1

8 years ago