From 4754e2445da1656b62aa74e2233aa241735c4501 Mon Sep 17 00:00:00 2001 From: Niels Simenon Date: Sun, 29 Apr 2018 04:13:01 +0200 Subject: [PATCH] Added npm script for running application. --- README.md | 7 ++++--- package.json | 7 ++++++- src/cli.js | 2 +- 3 files changed, 11 insertions(+), 5 deletions(-) diff --git a/README.md b/README.md index 8df19e2..fda8291 100644 --- a/README.md +++ b/README.md @@ -33,7 +33,7 @@ reddit-post-dump requires a arbitrarily recent version of Node.js. Before use, d `npm install` ## Usage -`node app.js (--user | --post )` +`npm start -- (--user | --post )` ### Optional arguments * `--users [...]`: You may fetch posts from multiple users by supplying a space-separated list of usernames to `--users`. @@ -43,8 +43,9 @@ reddit-post-dump requires a arbitrarily recent version of Node.js. Before use, d * `--ignore [...]`: Ignore posts with any of the following properties: `pinned`, `stickied`, `hidden`, `over_18`, `spoiler`. ### Examples -* `node app.js --user=ThePendulum` -* `node app.js --user=ThePendulum --limit=10 --sort=top` +* `npm start -- --user AWildSketchAppeared` +* `npm start -- --users ShittyWatercolour AwildSketchAppeared --limit 10 --sort top` +* `npm start -- --user GallowBoob --limit 50 --ignore pinned stickied` #### Reddit videos The audio stream for videos with sound uploaded to reddit directly (v.redd.it) is hosted separately, and will be saved as such alongside the video (typically {filename}-0 and {filename}-1). For them to be muxed into a single file automatically, **ffmpeg must be available on the system**, and the separate source files will be deleted when muxing has succeeded. If ffmpeg is not available, the separate files will remain as is. diff --git a/package.json b/package.json index d5ce06a..8366c5b 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,12 @@ "description": "Reddit user post dump tool with versatile saving patterns and fallback searches for deleted users.", "main": "app.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node src/app.js" + }, + "pkg": { + "scripts": "src/app.js", + "out-path": "dist/", + "assets": "config/*" }, "repository": { "type": "git", diff --git a/src/cli.js b/src/cli.js index d790593..6d5bd5c 100644 --- a/src/cli.js +++ b/src/cli.js @@ -3,7 +3,7 @@ const config = require('config'); const yargs = require('yargs'); -module.exports = yargs.option('users', { +module.exports = yargs.command('npm start -- --user ').option('users', { alias: 'user', describe: 'Reddit usernames to fetch posts from', type: 'array'