0.5.1 • Published 6 years ago

transfer.js v0.5.1

Weekly downloads
2
License
ISC
Repository
github
Last release
6 years ago

transfer.js

Version Build Status License Coverage

Node.js CLI tool for easy file sharing with transfer.sh

Install

The easiest way to get transfer.js is with npm or yarn:

$ npm install -g transfer.js
$ yarn global add transfer.js

CLI Usage

Example

$ transfer-js hello.txt --copy

Will return a link to the resource and copy it to your clipboard.

Options

OptionDescription
-m, --max-daysMaximum number of days the file will stay on transfer.sh.
-M, --max-downloadsMaximum number of downloads allowed.
-D, --downloadDownload the file from the given URL.
-n, --file-nameName to use for the upload.
-c, --copyCopy the file URL or path to the clipboard.
-N, --no-progressDon't show the progress bar.
-o, --outputOutput path of the downloaded file.

Module usage

Example

const Transfer = require('transfer.js');

// Upload
new Transfer('./Hello.txt')
  .upload().progress((prog) => {
    console.log((prog.current / prog.total * 100).toFixed(1) + '%');
  }).then(console.log).catch(console.error);

// Download
new Transfer('https://transfer.sh/4bcD3/Hello.txt')
  .download().progress((prog) => {
    console.log((prog.current / prog.total * 100).toFixed(1) + '%');
  }).then(console.log).catch(console.error);

Documentation

The documentation is available here.

Dependencies Dependencies

  • cli-progress: Easy to use Progress-Bar for Command-Line/Terminal Applications
  • clipboardy: Access the system clipboard (copy/paste)
  • got: Simplified HTTP requests
  • mime-types: The ultimate javascript content-type utility.
  • minimist: parse argument options
  • progress-promise: Promise subclass with mechanism to report progress before resolving

Dev Dependencies Dev Dependencies

  • @reconbot/jsdoc-theme: A JSDoc Theme / Template
  • chai: BDD/TDD assertion library for node.js and the browser. Test framework agnostic.
  • chai-as-promised: Extends Chai with assertions about promises.
  • codecov: Uploading report to Codecov: https://codecov.io
  • eslint: An AST-based pattern checker for JavaScript.
  • jsdoc: An API documentation generator for JavaScript.
  • mocha: simple, flexible, fun test framework
  • nyc: the Istanbul command line interface

TODO

  • Add more options to the executable
  • Use a better argument parser
  • Allow custom transfer domains
  • Add more download tests
  • Add executable tests

Credits

Based on transfer-sh by roccomuso.

0.5.1

6 years ago

0.5.0

7 years ago

0.4.0

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.1

7 years ago

0.1.0

7 years ago

0.0.2

7 years ago