node package manager
Share your code. npm Orgs help your team discover, share, and reuse code. Create a free org »


transfer-sh NPM Version bitHound Overall Score Dependency Status JavaScript Style Guide Patreon donate button

Node.js CLI tool for easy file sharing using


The easiest way to get transfer-sh is with npm:

$ npm install -g transfer-sh

CLI Usage

$ transfer hello.txt

Will return a link to the resource and automatically you'll have it copied to your clipboard.

PS. transfer is an alias for transfer-sh.

Encrypt a file using a password:

$ transfer hello.txt -p s3cr3t


var Transfer = require('transfer-sh')
/* Encrypt and Upload */
new Transfer('./', {password: 's3cr3t'})
  .then(function (link) { console.log(link) })
  .catch(function (err) { console.log(err) })
/* Decrypt */
new Transfer('./Hello.enc', {password: 's3cr3t'})
  .then(function (wStream) { console.log('Decrypted!') }) // it returns a writableStream
  .catch(function (err) { console.log(err) })


password: optional field, if provided will encrypt the file with aes-256-cbc no-salt and base64 encoded before the upload.

You can then easily decrypt your file using transfer-sh itself:

$ transfer -d hello.enc -p s3cr3t [-o output.txt]

or the openssl util:

$ openssl aes-256-cbc -d -a -nosalt -in <encrypted_file> -out <destination> -k <password>

openssl param explanation:

-d decrypt.

-a to decode base64 (with line break). NB. The file is base64 encoded to be easy human-readable and to allow easy copy-paste.

-nosalt The used node crypto lib by default doesn't apply any salt.

-in input encrypted file.

-out output decrypted file.

-k password.


Rocco Musolino