mirror of
https://github.com/morhetz/gruvbox.git
synced 2025-11-15 14:53:46 -05:00
800 B
800 B
null-check 
Ensure a path doesn't contain null bytes
The same check as done in all the core fs methods.
Install
$ npm install --save null-check
Usage
var nullCheck = require('null-check');
nullCheck('unicorn.png\u0000', function (err) {
console.log(err);
//=> { [Error: Path must be a string without null bytes.] code: 'ENOENT' }
});
//=> false
// the method is sync without a callback
nullCheck('unicorn.png');
//=> true
License
MIT © Sindre Sorhus