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

parse-function

Package Overview
Dependencies
Maintainers
2
Versions
86
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

parse-function

Parse a function into an object using espree, acorn or babylon parsers. Extensible through Smart Plugins

  • 5.6.5
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
132K
decreased by-17.01%
Maintainers
2
Weekly downloads
 
Created

What is parse-function?

The parse-function npm package is a utility for parsing JavaScript functions to extract their name, parameters, and body. It is useful for analyzing and manipulating functions programmatically.

What are parse-function's main functionalities?

Parse Function

This feature allows you to parse a JavaScript function to extract its name, parameters, and body. The code sample demonstrates how to parse a simple function and log the parsed details.

const parseFunction = require('parse-function')();
const parsed = parseFunction.parse(function example(a, b) { return a + b; });
console.log(parsed);

Parse Arrow Function

This feature allows you to parse an arrow function. The code sample demonstrates how to parse an arrow function and log the parsed details.

const parseFunction = require('parse-function')();
const parsed = parseFunction.parse((a, b) => a + b);
console.log(parsed);

Parse Async Function

This feature allows you to parse an async function. The code sample demonstrates how to parse an async function and log the parsed details.

const parseFunction = require('parse-function')();
const parsed = parseFunction.parse(async function example(a, b) { return a + b; });
console.log(parsed);

Other packages similar to parse-function

Keywords

FAQs

Package last updated on 29 Feb 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