Skip to content

JavaScript implementation of data transformations using generators.

License

Notifications You must be signed in to change notification settings

rybarix/mapflow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Mapflow

Lazy evaluation of JavaScript data transformation with a similar API to chaining the map function.

An alternative to calling multiple .map() calls on large arrays and waiting until the entire operation is processed.

⚠️ No support for async generators right now.

Example

const mp = new MapFlow([1,2,3,4,5]); // very large array
mp.alter((num, index) => {
	return num**2;
}).alter((num) => num**2);

// Using iterables:
for (const n of mp.generator()) {
	// n
}

// or manually using next():
const g = mp.generator();
const n = g.next().value; // get single value

Development

Run tests using npm test

About

JavaScript implementation of data transformations using generators.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published