23 lines
523 B
Bash
23 lines
523 B
Bash
|
|
#!/bin/bash
|
||
|
|
# https://docs.sheetjs.com/docs/demos/math/tensorflow#nodejs-demo
|
||
|
|
. ~/.bashrc ## This is apparently needed in macos
|
||
|
|
|
||
|
|
cd /tmp
|
||
|
|
rm -rf sheetjs-tfjs-csv
|
||
|
|
|
||
|
|
mkdir sheetjs-tfjs-csv
|
||
|
|
cd sheetjs-tfjs-csv
|
||
|
|
npm init -y
|
||
|
|
|
||
|
|
npm i --save https://cdn.sheetjs.com/xlsx-latest/xlsx-latest.tgz @tensorflow/tfjs @tensorflow/tfjs-node
|
||
|
|
|
||
|
|
curl -LO https://docs.sheetjs.com/tfjs/SheetJSTF.js
|
||
|
|
|
||
|
|
# this version uses `nvm` to cycle through node versions
|
||
|
|
for n in 20 22 24; do
|
||
|
|
#sudo n $n
|
||
|
|
nvm use $n
|
||
|
|
node --version
|
||
|
|
node SheetJSTF.js
|
||
|
|
done
|