Yarn has `yarn licenses list`[1], which is very useful. And there is an accepted RFC for `yarn licenses check`[2] they would check against a list of allowed licenses.
[1] https://yarnpkg.com/lang/en/docs/cli/licenses/
[2] https://github.com/yarnpkg/rfcs/blob/master/accepted/0000-li...