1.0.5 • Published 8 years ago

sequential-data-provider v1.0.5

Weekly downloads
3
License
MIT
Repository
github
Last release
8 years ago

#sequential-data-provider

Simple module that provides sequentially rows of data as objects to a function. The objects get their properties' names from the first row of the data.

It is intended to be used as a PHPUnit-like data-provider to provide data to unit tests, although it could be used for any other purpose that fits.

Inspired by:

##Installation

Just run

npm install sequential-data-provider --save-dev

Or if you will be using it in production environment, run

npm install sequential-data-provider --save

##Usage

var populate = require('sequential-data-provider');

var data = [
    ['name', 'age'],
    ['Frodo', 50],
    ['Aragorn', 87],
    ['Legolas', 2931]
];

populate(data, console.log);

Prints:

 { name: 'Frodo', age: 50 }
 { name: 'Aragorn', age: 87 }
 { name: 'Legolas', age: 2931 }

##Test

You can test it by doing:

cd node_modules/sequential-data-provider
npm install
npm test
1.0.5

8 years ago

1.0.4

8 years ago

1.0.3

8 years ago

1.0.2

8 years ago

1.0.1

8 years ago

1.0.0

8 years ago