fibonacci-generator-function
Advanced tools
Comparing version 1.0.1 to 2.0.0
11
index.js
@@ -1,3 +0,6 @@ | ||
const fibGen = function* (start = 1) | ||
{ | ||
/** | ||
* Generator function that yields numbers according to the fibonacci sequence | ||
* @param {number} start | ||
*/ | ||
const fibGen = function* (start = 1) { | ||
let a = start; | ||
@@ -14,4 +17,4 @@ let b = 0; | ||
} | ||
}; | ||
exports.fibGen = fibGen; | ||
module.exports = fibGen; |
{ | ||
"name": "fibonacci-generator-function", | ||
"version": "1.0.1", | ||
"version": "2.0.0", | ||
"description": "Generator function yielding the next number in a fibonacci sequence. Optional starting param.", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -5,17 +5,9 @@ # Fibonacci Generator Function - JavaScript | ||
## Installation | ||
`npm install fibonacci-generator-function` | ||
## Usage | ||
```javascript | ||
// Node.JS | ||
const {fibGen} = require('fibonacci-generator-function'); | ||
npm install fibonacci-generator-function | ||
// ES2015+ | ||
import {fibGen} from 'fibonacci-generator-function'; | ||
``` | ||
const fibGen = require('fibonacci-generator-function'); | ||
## Usage | ||
```javascript | ||
const fib = fibGen(); // Default sequence start of 1 | ||
const fib1 = fibGen(); // Default sequence start of 1 | ||
const fib3 = fibGen(3); // Start sequence at 3 | ||
@@ -22,0 +14,0 @@ |
@@ -1,2 +0,2 @@ | ||
const {fibGen} = require('./index.js'); | ||
const fibGen = require('./index.js'); | ||
@@ -3,0 +3,0 @@ const fib1 = fibGen(); // 1 is default param |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
16520
5
24
28