This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//Node.js script to convert CSV to JSON | |
var fs = require('fs'); | |
//Parameters | |
var infile = process.argv[2]; //First command line arg | |
var outfile = process.argv[3] || (infile + ".json"); //Last command line arg or add ".json" extension | |
//Read CSV file | |
var content = fs.readFileSync(infile, 'utf8'); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const fs = require('fs'); | |
const path = require('path'); | |
const readline = require('readline'); | |
const {google} = require('googleapis'); | |
const SCOPES = ['https://www.googleapis.com/auth/gmail.readonly']; | |
const TOKEN_PATH = 'token.json'; | |
const OUTPUT_FOLDER = './output'; | |
const METADATA_FILE = 'metadata.json'; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/*** A very simple pastebin clone ***/ | |
const fs = require('fs'); | |
const path = require('path'); | |
const http = require('http'); | |
const host = process.env.NODE_HOST || "0.0.0.0"; | |
const port = process.env.NODE_PORT || 3000; | |
const datadir = process.env.NODE_DATA_DIR || "data"; |