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
//http://stackoverflow.com/questions/5754153/zip-archives-in-node-js | |
var spawn = require('child_process').spawn; | |
app.get('/scripts/archive', function(req, res) { | |
// Options -r recursive -j ignore directory info - redirect to stdout | |
var zip = spawn('zip', ['-rj', '-', SCRIPTS_PATH]); | |
res.contentType('zip'); | |
// Keep writing stdout to res | |
zip.stdout.on('data', function (data) { |
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
class Car { | |
constructor(doors = 4, state = "brand new", color = "silver") { | |
this.doors = doors | |
this.state = state | |
this.color = color | |
} | |
} | |
class Truck { |