okfn/datapackage.js — pull request #5 by sballesteros (2013-11-13 03:41:10+00:00)
Title: Streams

First toy version (with poor integration with the rest of the module for now).

In case of foreignkeys (necessitating to do I/O to get the other package.json nested in node_modules/ folders) I used some PassThrough streams to avoid callbacks. Like that we can directly use constructs like:
```datapackage.stream(dpgkRoot, dpkg, resourceName).pipe(writableStream)```
Would love to learn if there is a better way.

tests are in tests/streams.js (run ```mocha streams.js``` in tests/ or ```npm test``` at the root of the repo).

Right now paths are assumed to be csv files and no validation nor type coercion is done.
I will add support for the ```format``` property and validation / type coercion using the schema in some next commits.
Will also add support for ```url```.

So more soon,
Sebastien