bayfiles-cli
Advanced tools
Comparing version 2.0.0 to 2.0.1
{ | ||
"name": "bayfiles-cli", | ||
"version": "2.0.0", | ||
"description": "a cli for bayfiles.com, anonfile.com and megaupload.nz", | ||
"version": "2.0.1", | ||
"description": "a cli for bayfiles.com, anonfile.com, megaupload.nz and forumfiles.com", | ||
"main": "index.js", | ||
@@ -6,0 +6,0 @@ "scripts": { |
# bayfiles-cli | ||
A cli for [bayfiles.com](https://bayfiles.com/), [anonfile.com](https://anonfile.com/), [megaupload.nz](https://megaupload.nz/) and [forumfiles](https://forumfiles.com/api/upload) file uploading and downloading. | ||
A cli for [bayfiles.com](https://bayfiles.com/), [anonfile.com](https://anonfile.com/), [megaupload.nz](https://megaupload.nz/) and [forumfiles.com](https://forumfiles.com/api/upload) file uploading and downloading. | ||
@@ -10,3 +10,3 @@ # Installation | ||
$ bayfilesupload | ||
bayfiles <files...> | ||
bayfilesupload <files...> | ||
@@ -13,0 +13,0 @@ Upload one or multiple files |
@@ -10,37 +10,30 @@ #!/usr/bin/env node | ||
require('yargs').command( | ||
require('yargs') | ||
.command( | ||
'$0 <urls...>', | ||
'Download one or multiple files', | ||
yargs => { | ||
yargs | ||
.positional('urls', { | ||
describe: 'The uploaded files to download', | ||
type: 'string' | ||
}) | ||
.option('quiet', { | ||
alias: 'q', | ||
describe: "If set, log messages won't be shown", | ||
type: 'boolean' | ||
}) | ||
.option('read-from-file', { | ||
alias: 'r', | ||
describe: 'Read the urls from a file' | ||
}) | ||
.option('retry', { | ||
alias: 't', | ||
describe: 'Retry if an http error occurs', | ||
type: 'boolean' | ||
}) | ||
.option('output', { | ||
alias: 'o', | ||
describe: 'Where to put the downloaded files' | ||
}) | ||
}, | ||
async ({ urls, quiet, r: readFrom, retry, output }) => { | ||
if (readFrom) | ||
urls.push( | ||
...(await fsReadFile(join(process.cwd(), readFrom)) | ||
'Download one or more files', | ||
yargs => yargs | ||
.positional('urls', { | ||
describe: 'The uploaded files to download or a file name where to find ', | ||
type: 'string' | ||
}) | ||
.option('quiet', { | ||
alias: 'q', | ||
describe: "If set, log messages won't be shown", | ||
type: 'boolean' | ||
}) | ||
.option('retry', { | ||
alias: 't', | ||
describe: 'Retry if an http error occurs', | ||
type: 'boolean' | ||
}) | ||
.option('output', { | ||
alias: 'o', | ||
describe: 'Where to put the downloaded files' | ||
}), | ||
async ({ urls, quiet, retry, output }) => { | ||
if (urls.length === 1 && !urls[0].match(/^https?:\/\//)) | ||
urls = (await fsReadFile(join(process.cwd(), urls[0]))) | ||
.toString() | ||
.split('\n')) | ||
) | ||
.split('\n') | ||
@@ -90,4 +83,1 @@ output = output || process.cwd() | ||
).argv | ||
process.on('unhandledRejection', console.error) | ||
process.on('uncaughtException', console.error) |
@@ -16,4 +16,4 @@ #!/usr/bin/env node | ||
'$0 <files...>', | ||
'Upload one or multiple files', | ||
yargs => { | ||
'Upload one or more files', | ||
yargs => | ||
yargs | ||
@@ -52,4 +52,3 @@ .positional('files', { | ||
type: 'boolean' | ||
}) | ||
}, | ||
}), | ||
async ({ | ||
@@ -118,3 +117,1 @@ site, | ||
).argv | ||
process.on('unhandledRejection', console.error) |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
4
14415
319