How to define a custom console.log if a script in package.json throws an error?

守給你的承諾、 提交于 2020-01-04 01:28:05

问题


Is it possible to add a custom console.log if my custom npm script throws an error? Or is it at all possible to add custom console.log to a script?

I have this entry in my scripts object of package.json:

"check": "npm list --depth=0 | grep"

And need a console.log specifically for this script.

来源:https://stackoverflow.com/questions/48006553/how-to-define-a-custom-console-log-if-a-script-in-package-json-throws-an-error

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!