Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

acorn-strip-function

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

acorn-strip-function

Remove functions from JavaScript source via acorn

  • 1.2.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
151
increased by36.04%
Maintainers
1
Weekly downloads
 
Created
Source

acorn-strip-function

Strip functions from JavaScript/JSX source via acorn.

Install

npm i acorn-strip-function --save

Usage

const stripFunction = require('acorn-strip-function')

console.log(stripFunction('function removeMe() {}', 'removeMe') === '')
// true

Reference

stripFunction(source, functionName, { tokens, settings })

  • source: Source code as string.
  • functionName: Name of function to be removed across code.
  • tokens: Provide existing acorn tokenizer instance, ignores source.
  • settings: Provide custom acorn settings (default: modules with latest JavaScript features).

License

MIT

FAQs

Package last updated on 04 Mar 2024

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