Bezier curve interpolation of any order of control points of any dimensionality. Uses the De Casteljau algorithm. Though this module may be useful for educational purposes, for a faster alternative check this.
$ npm install bezier-curve
var bezier = require('bezier-curve');
var points = [
[-1.0, 0.0],
[-0.5, 0.5],
[ 0.5, -0.5],
[ 1.0, 0.0]
];
for(var t=0; t<1; t+=0.01) {
var point = bezier(t, points);
}