Skip to content

get the call function statement location in source code like magic✨✨

License

Notifications You must be signed in to change notification settings

tokisakiyuu/where-call

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

6 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Where Call

install

npm install where-call

functions

  • whereIsCallFunction(): Info | null
// source.js
function foo() {
  return whereIsCallFunction();
}
const location = foo();
//       │       ↑
//       └───────┘
//     source.js:4:17
  • whereIsHere(): Info | null
// source.js
function foo() {
  const location = whereIsHere();
//         │       ↑
//         └───────┘
//       source.js:2:19
}
foo();

object

  • Info: location detail
    • line: number
    • column: number
    • file: string

Related

About

get the call function statement location in source code like magic✨✨

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published