I couldn't find any way to do this in a cross-platform way. POSIX shell has the ! operator that can do that, but I couldn't find a way to do it on Windows. It could work like an exec command that negates the exit code of the execution.
Sample use case: Stop a commit using husky if any file contains string DO_NOT_COMMIT_THIS. "pre-commit": "shx not grep -rq DO_NOT_COMMIT_THIS ."