Sha256: 80913ef1762b13fb964f9a64f2a6e9e89718da23c195afb4a7669f9824b46008

Contents?: true

Size: 800 Bytes

Versions: 3

Compression:

Stored size: 800 Bytes

Contents

# null-check [![Build Status](https://travis-ci.org/sindresorhus/null-check.svg?branch=master)](https://travis-ci.org/sindresorhus/null-check)

> Ensure a path doesn't contain [null bytes](http://en.wikipedia.org/wiki/Null_character)

The same check as done in all the core [`fs` methods](https://github.com/iojs/io.js/blob/18d457bd3408557a48b453f13b2b99e1ab5e7159/lib/fs.js#L88-L102).


## Install

```
$ npm install --save null-check
```


## Usage

```js
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](http://sindresorhus.com)

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hooch-0.4.2 jasmine/node_modules/karma-chrome-launcher/node_modules/fs-access/node_modules/null-check/readme.md
hooch-0.4.1 jasmine/node_modules/karma-chrome-launcher/node_modules/fs-access/node_modules/null-check/readme.md
hooch-0.4.0 jasmine/node_modules/karma-chrome-launcher/node_modules/fs-access/node_modules/null-check/readme.md