diff options
Diffstat (limited to 'src/crawl-itunes.js')
-rwxr-xr-x | src/crawl-itunes.js | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/src/crawl-itunes.js b/src/crawl-itunes.js index e6b63b3..ce9ebf9 100755 --- a/src/crawl-itunes.js +++ b/src/crawl-itunes.js @@ -109,7 +109,7 @@ async function crawl( return resultGroup } -async function main(args) { +async function main(args, shouldReturn = false) { let playlist try { @@ -137,7 +137,12 @@ async function main(args) { } } - console.log(JSON.stringify(playlist, null, 2)) + const str = JSON.stringify(playlist, null, 2) + if (shouldReturn) { + return str + } else { + console.log(str) + } } module.exports = {main, crawl} |