# parser-csv [![NPM version](https://badge.fury.io/js/parser-csv.svg)](http://badge.fury.io/js/parser-csv)

> CSV parser, compatible with [parser-cache].

## Install

### Install with [npm](npmjs.org)

```bash
npm i parser-csv --save
```

## Run tests

```bash
npm test
```

## Usage
```js
var parser = require('parser-csv');
```

See [parse-csv] for the full range of options and features, and to report issues related to parsing.

### parse

```js
parser.parse(str, options, function(err, res) {
  if (err) { throw err; }
  console.log(res);
});
```

### parseFile

```js
parser.parseFile('fixtures/a.csv', function (err, res) {
  if (err) { throw err; }
  console.log(res);
});
```

### parseSync

```js
var res = parser.parseSync(str, options);
console.log(res);
```

## API

### [parse](index.js#L32)

* `str` **{String|Object}**: The object or string to parse.    
* `options` **{Object|Function}**: or `cb` callback function.    
* `cb` **{Function}**: callback function.    

Parse the given `str` of CSV and callback `cb(err, json)`.

### [parseSync](index.js#L57)

* `str` **{String|Object}**: The object or string to parse.    
* `returns`: {Object}  

Parse the given `str` of CSV and return an object.

### [parseFile](index.js#L76)

* `str` **{String|Object}**: The object or string to parse.    
* `returns`: {Object}  

CSV file support. Parse the given `str` of CSV and callback `cb(err, data)`.

### [parseFileSync](index.js#L105)

CSV file support. Parse a file at the given `fp`.

* `fp` **{String}**    
* `options` **{Object}**: Options to pass to [parse-csv]    

```js
parser.parseFile('foo/bar/baz.csv');
```


## Contributing

Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/jonschlinkert/parser-csv/issues)

## Author

**Jon Schlinkert**
 
+ [github/jonschlinkert](https://github.com/jonschlinkert)
+ [twitter/jonschlinkert](http://twitter.com/jonschlinkert) 

## License
Copyright (c) 2014 Jon Schlinkert  
Released under the MIT license

***

_This file was generated by [verb](https://github.com/assemble/verb) on November 24, 2014._

[parser-cache]: https://github.com/jonschlinkert/parser-cache
[parse-csv]: https://github.com/jonschlinkert/parse-csv