$ cnpm install null-check
Ensure a path doesn't contain null bytes
$ npm install --save null-check
const nullCheck = require('null-check');
try {
nullCheck('unicorn.png\u0000');
} catch (err) {
//=> 'Path must be a string without null bytes.'
}
MIT © Sindre Sorhus
Copyright 2013 - present © cnpmjs.org