Created
February 12, 2016 19:12
-
-
Save alivesay/f05591ab056562def17d to your computer and use it in GitHub Desktop.
This file contains hidden or 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
function do_something_with_dir_list(stdout) { | |
res.render('index', { | |
title: 'MyPage', | |
subtitle: 'Below is a directory listing', | |
results: stdout | |
}); | |
} | |
function dir_list(dir_list_done) { | |
var sys = require('sys'); | |
var exec = require('child_process').exec | |
exec('ls -la', function(error, stdout, stderr) { | |
return dir_list_done(stdout); | |
}); | |
} | |
app.get('/', function(req, res){ | |
dir_list(do_something_with_dir_list); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment