use esprima to parse the file instead of searching for sub-strings