Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

fibonacci-generator-function

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

fibonacci-generator-function - npm Package Compare versions

Comparing version 1.0.1 to 2.0.0

.idea/workspace.xml

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

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