Better checking for package.json file