Package Exports
- @putout/operate
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@putout/operate) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
Operate

operate provide you a way to manipulate path nodes and keep comments and loc information you need
to build the same source file you had before parsing with help of recast.
Install
npm i @putout/operateIf you use write plugin for putout you already have operate in putout, all exampes will get operate from putout, but you can use direct require as well.
API
replaceWith(path, node)
const {replaceWith} = require('putout').operate;
replaceWith(path, ContinueStatement);replaceWithMultiple(path, nodes)
const {replaceWithMultiple} = require('putout').operate;
replaceWith(path, [
ExpressionStatement(path.node.argument),
ContinueStatement,
]);isModuleExports(path)
Check if currentPath is module.exports expression.
toExpression(node)
Can be used to convert node to expression when building new nodes.
License
MIT