gkz / grasp

JavaScript structural search, replace, and refactor

Home Page:http://graspjs.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Using graspjs to instrument functions

retorquere opened this issue · comments

I am looking to add a statement to the top of all functions and methods, such that

function x(a) {
  ...
}
const y = (b) => {
  ...
}
class C {
  z(c) {
    ...
  }
}

comes out something like

function x(a) {
  console.log("x(a)")
  ...
}
const y = (b) => {
  console.log("?(b)")
  ...
}
class C {
  z(c) {
    console.log("z(c)")
    ...
  }
}

is this possible using graspjs?