Validador da numeração CNJ escrito em JavaScript com suporte para navegadores, pegar e usar.
npm install validate-cnj --save
import { Validate } from 'validate-cnj'
Validate.load("1500345-34.2017.8.26.0248")
// Thrown: ValidateCNJException: Checksum not correct - CNJ number is invalid. Expected is 31, received 34.
Validate.load("1500345-31.2017.8.26.0248")
// ValidateCNJ {
// dv: '31',
// proc: '1500345',
// year: '2017',
// justice: '8',
// number: '26',
// court: '0248'
// }
Validate.load("1500345-31.2017.8260248").generate(true)
// '1500345-31.2017.8.26.0248'
Validate.load("1500345-31.2017.8260248").generate(false)
// '15003453120178260248'
Validate.factory("1500345", {justice:8, court: 248, number: 26}, 2020).generate(true)
// '1500345-26.2020.8.26.0248'