It's a very small package that sets out to validate Spanish DNI and NIE. It contains simple functions where the string will be validated against the formula to check whether is valid or not.
$ npm install dni-js-validator --save
var dni = require("dni-js-validator")
dni.isValid('12345678Z') // => 'true'