Added npm script for running application.

This commit is contained in:
ThePendulum 2018-04-29 04:13:01 +02:00
parent ab816204d0
commit 4754e2445d
3 changed files with 11 additions and 5 deletions

View File

@ -33,7 +33,7 @@ reddit-post-dump requires a arbitrarily recent version of Node.js. Before use, d
`npm install` `npm install`
## Usage ## Usage
`node app.js (--user <username> | --post <post-id>)` `npm start -- (--user <username> | --post <post-id>)`
### Optional arguments ### Optional arguments
* `--users <username> [<username>...]`: You may fetch posts from multiple users by supplying a space-separated list of usernames to `--users`. * `--users <username> [<username>...]`: 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 <prop> [<prop>...]`: Ignore posts with any of the following properties: `pinned`, `stickied`, `hidden`, `over_18`, `spoiler`. * `--ignore <prop> [<prop>...]`: Ignore posts with any of the following properties: `pinned`, `stickied`, `hidden`, `over_18`, `spoiler`.
### Examples ### Examples
* `node app.js --user=ThePendulum` * `npm start -- --user AWildSketchAppeared`
* `node app.js --user=ThePendulum --limit=10 --sort=top` * `npm start -- --users ShittyWatercolour AwildSketchAppeared --limit 10 --sort top`
* `npm start -- --user GallowBoob --limit 50 --ignore pinned stickied`
#### Reddit videos #### 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. 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.

View File

@ -4,7 +4,12 @@
"description": "Reddit user post dump tool with versatile saving patterns and fallback searches for deleted users.", "description": "Reddit user post dump tool with versatile saving patterns and fallback searches for deleted users.",
"main": "app.js", "main": "app.js",
"scripts": { "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": { "repository": {
"type": "git", "type": "git",

View File

@ -3,7 +3,7 @@
const config = require('config'); const config = require('config');
const yargs = require('yargs'); const yargs = require('yargs');
module.exports = yargs.option('users', { module.exports = yargs.command('npm start -- --user <username>').option('users', {
alias: 'user', alias: 'user',
describe: 'Reddit usernames to fetch posts from', describe: 'Reddit usernames to fetch posts from',
type: 'array' type: 'array'