New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@putout/operate

Package Overview
Dependencies
Maintainers
1
Versions
100
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@putout/operate

operate on ast

  • 5.0.1
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
10K
decreased by-25.76%
Maintainers
1
Weekly downloads
 
Created
Source

Operate NPM version Dependency Status Build Status Coverage Status

operate provide you a way to manipulate path nodes and keep comments and loc information.

Install

npm i @putout/operate

If you write plugin for putout you already have operate in putout, all exampes will get operate from putout, but you can use direct require('@putout/operate') 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.

remove(path)

Remove node, preserve comments.

License

MIT

Keywords

FAQs

Package last updated on 18 Nov 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc