Check if a number is in the Fibonacci sequence
Only the first twenty Fibonacci numbers are used. Feel free to replace the algorithm as long as it is fast and synchronous.
Install with component(1):
$ component install hkjels/is-fibonacci
var isFibonacci = require('is-fibonacci');
if (isFibonacci(5)) {
console.log('Five is a fibonacci number');
}
MIT