New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

layzee

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

layzee

A minimal lazy iterator implementation

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

layzee

A minimal lazy iterator implementation

version build status npm Codecov

install

$ npm install layzee

docs

usage

import layzee from 'layzee'

let range = layzee.range
let iter = layzee([1,2,3,4,5])

for (let o of iter) {
  // do stuff
}

// using range
let r = range(0, 100) // generates [10..20)
r.filter(o => o % 11 === 0).take(3)
r.next() // { value: 0, done: false}
r.value() // [11, 22] iterator is fully realized
r.value() // [11, 22] - result is cached after first call to value()
r.next() // { done: true }

// using generators
  function* genEven () {
    let i = 0
    while (i % 2 === 0) {
      i += 2
      yield i
    }
  }

  let even5 = layzee(genEven()).take(5)
  even5.value() // [2,4,6,8,10]

license

MIT

Keywords

FAQs

Package last updated on 23 Apr 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc