🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

function-location

Package Overview
Dependencies
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

function-location

Retrieving the function location in JavaScript.

npmnpm
Version
0.0.1-beta.0
Version published
Weekly downloads
9
-43.75%
Maintainers
1
Weekly downloads
 
Created
Source

This library is currently in beta and not fully stable.

Description

The function-location library is a tool for finding the location of the currently executing function in a JavaScript environment. By utilizing this library, you can extract the source file path of the executing function.

Installation

npm i function-location

Usage

import { locate } from 'function-location';

function myFunction() {
    const sourceFilePath = locate();
    console.log(sourceFilePath);
}

myFunction();

Return Value

The locate() function returns the source file path of the currently executing function as a string. If the function's location cannot be determined, it returns undefined.

License

This library is provided under the MIT license. The copyright for the relevant code is subject to that license.

Keywords

[[FunctionLocation]]

FAQs

Package last updated on 20 Aug 2023

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