aboutsummaryrefslogtreecommitdiff
path: root/upload.js
diff options
context:
space:
mode:
authorsotech117 <michael_foiani@brown.edu>2025-08-26 23:37:53 -0400
committersotech117 <michael_foiani@brown.edu>2025-08-26 23:37:53 -0400
commita89d60f5886426f12e5d614285fbb51d788c2e75 (patch)
tree8caa063805c7b81d1f6e33c1efabb4bf819dd207 /upload.js
parent92bd0f599de615667ffea46daeb4ed00d4a27a5c (diff)
added server code and readme
Diffstat (limited to 'upload.js')
-rw-r--r--upload.js10
1 files changed, 4 insertions, 6 deletions
diff --git a/upload.js b/upload.js
index 7e91f1a..5df247b 100644
--- a/upload.js
+++ b/upload.js
@@ -1,5 +1,5 @@
-const fs = require('fs');
-const crypto = require('crypto');
+import fs from 'fs';
+import crypto from 'crypto';
// load in google credentials json file
const credentialsPath = 'google_credentials.json';
@@ -153,7 +153,7 @@ const getRowsFromTSV = (tsvPath) => {
return rows;
}
-const main = async () => {
+export const runUpload = async () => {
// // get the data from the tsv
// const tsvPath = 'sp500_formatted_data.tsv';
// const tsvData = fs.readFileSync(tsvPath, 'utf8');
@@ -197,6 +197,4 @@ const main = async () => {
} catch (error) {
console.error('Error:', error);
}
-}
-
-main(); \ No newline at end of file
+} \ No newline at end of file