@lavadrop/fib
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

@lavadrop/fib

npm license Travis Build Status codecov Try @lavadrop/fib on RunKit

Part of a library of zero-dependency npm modules that do just one thing.

npm

min + gzip | 99 bytes

source

A Fibonacci sequence generator.

Usage

import fib from '@lavadrop/fib'

const fibs = fib()
fibs.next() // { done: false, value: 0 }
fibs.next() // { done: false, value: 1 }
fibs.next() // { done: false, value: 1 }
fibs.next().value
// => 2

Parameters

none

Returns

A Fibonacci sequence iterator. It never ends, so the result of next() will always contain done: false.

Return type

Generator<number, number, number>

Package Sidebar

Install

npm i @lavadrop/fib

Weekly Downloads

0

Version

1.0.0

License

MIT

Unpacked Size

8.41 kB

Total Files

8

Last publish

Collaborators

  • jedmao