Skip to content

Wollantine/sequential-data-provider

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

#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

About

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.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published