js-itertools icon indicating copy to clipboard operation
js-itertools copied to clipboard

:hammer_and_wrench: Python's iterable and iterator library for JavaScript

:hammer_and_wrench: js-itertools License


© xkcd.com

Python's iterable and iterator library for JavaScript. Parent is js-library.

:warning: Depending on your environment, the code may require regeneratorRuntime to be defined, for instance by importing regenerator-runtime/runtime.

import {cycle} from '@iterable-iterator/cycle';
import {chain} from '@iterable-iterator/chain';
cycle( chain( [ 0 , 1 , 2 ] , [ 3 , 4 , 5 ] ) ) ; // 0 1 2 3 4 5 0 1 ...

:newspaper: Description

The goal of this project is to make (the parts that interest me of) the following python constructs/idioms/libraries available in JavaScript under the AGPL-3.0 license.

The corresponding software library used to be released as a monolith. It has since been split up into multiple packages.

:deciduous_tree: Hierarchy

The packages are released under multiple npm @scopes. Extra features are marked with a *.

@iterable-iterator

@combinatorics

@set-theory

:link: More references in Python and JavaScript

  • http://mochi.github.io/mochikit/doc/html/MochiKit/Iter.html
  • https://github.com/cweider/js-itertools
  • http://itertoolsjs.com
  • https://github.com/thegoleffect/node-itertools
  • http://rfw.name/sloth.js
  • https://github.com/lodash/lodash
  • https://github.com/StreetStrider/aux.js