Tom-Alexander/regression-js

How to use this library with node.js (server) side?

Closed this issue · 2 comments

daluu commented

For case of not using in browser, other than copy and pasting the code into one's main codebase or modifying the library to export its functions, is there any way the current library can be imported for use in node.js CLI/script or server side code? e.g.

regression = require('regression-js'); 
//or regression = require('./pathTo/regression.min.js');
var data = [[0,1],[32, 67] .... [12, 79]];
var result = regression('linear', data);

This module works on node. It can be installed with npm:

npm install --save regression
daluu commented

Ok thanks. So one then just needs to do regression = require('regression'); to use it.