Skip to content

thegoleffect/node-itertools

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Itertools

This is an initial attempt to port some of Python's itertools functions to node.

Quick example:

var itertools = require("itertools");
var fruitBaskets = itertools.permutationsSync(["Apple", "Orange", "Banana"], 2);
// fruitBaskets = [['Apple', 'Orange'], ['Apple', 'Banana'], ['Orange', 'Apple'], ['Orange', 'Banana'], ['Banana', 'Apple'], ['Banana', 'Orange']]

Install

$ npm install itertools

OR

$ git clone git://github.com/thegoleffect/node-itertools.git

THEN

var itertools = require('itertools');

API

Since this is a new port, these are the only functions completed thus far:

itertools.permutationsSync(iterable[, r])

    Returns list of r length permutations of elements in the iterable.

About

This is the product of my insomnia.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published