Skip to content
This repository has been archived by the owner on Jan 24, 2021. It is now read-only.

sindresorhus/rocambole-node-update

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Deprecated

The Rocambole project is no longer maintained.


rocambole-node-update Build Status

Update a rocambole AST node

Install

$ npm install rocambole-node-update

Usage

const rocambole = require('rocambole');
const updateNode = require('rocambole-node-update');

rocambole.moonwalk('if (true) { foo() }', node => {
	if (node.type === 'CallExpression') {
		updateNode(node, 'bar()');
	}
}).toString();
//=> 'if (true) { bar() }'

License

MIT © Sindre Sorhus