GithubHelp home page GithubHelp logo

parvardegr / sharing Goto Github PK

View Code? Open in Web Editor NEW
1.7K 5.0 71.0 195 KB

Sharing is a command-line tool to share directories and files from the CLI to iOS and Android devices without the need of an extra client app

License: MIT License

JavaScript 83.21% HTML 16.79%
android browser command-line-tool filesharing filesharing-on-network filetransfer ios linux nodejs qrcode

sharing's Introduction

sharing

Share directories and files from the CLI to iOS and Android devices without the need of an extra client app

Sharing screenshot

  • share directory and file
  • share your clipboard
  • receive file
  • support basic authentication
  • support ssl

Usage

sharing is depend on node v16.x or later

  1. Install
    • npm install -g easy-sharing
  2. Share a file or directory
    • sharing /directory-or-file-to-share
  3. Scan the QR-Code with your phone
    • both devices must connect to the same Wi-Fi or, if you have a public IP address, use the --ip parameter.
      • sharing --ip your-public-ip-address /directory-or-file-to-share
  4. Tada! Just browse the directory and download any file you want

note: macos users should use easy-sharing binary instead of sharing

example: easy-sharing /file-or-directory

$ sharing --help

Usage:
• Share file or directory
$ sharing /path/to/file-or-directory

• Share clipboard
$ sharing -c

• Receive file
$ sharing /destination/directory --receive;

• Share file with Basic Authentication
$ sharing /path/to/file-or-directory -U user -P password  # also works with
--receive

Options:
      --version                     Show version number                [boolean]
      --debug                       enable debuging logs
  -p, --port                        Change default port
      --ip                          Your machine public ip address
  -c, --clipboard                   Share Clipboard
  -t, --tmpdir                      Clipboard Temporary files directory
  -w, --on-windows-native-terminal  Enable QR-Code support for windows native
                                    terminal
  -r, --receive                     Receive files
  -q, --receive-port                change receive default port
  -U, --username                    set basic authentication username
                                                               [default: "user"]
  -P, --password                    set basic authentication password
      --help                        Show help                          [boolean]

TODO

  • zip the file before transferring it (sharing --zip /path/to/file)
  • self-signed certificate creation
  • new banner screenshot (also show the --receive functionality)

sharing's People

Contributors

colgin avatar frogred8 avatar imyuanx avatar levinotik avatar parvardegr avatar pierre-x avatar raimonomiar avatar seven-y-q-guo avatar shrthk-7 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

sharing's Issues

QR code as text

Is it correct that my phone recognize de QR code as a text instead of a link?
Probably need a config.qrcode addition in index.js?

Run without sudo

Why sharing requires root permission? At least better explanation needed.

Hashtag is not being properly urlencoded

If there is a hashtag in the name of the file being shared, you will get a 404.

Example:

File name:
Samurai, #1)-Ravensburger Buchverlag (2011).epub

Current encoding:
http://192.168.178.45:7478/Samurai,%20#1)-Ravensburger%20Buchverlag%20(2011).epub

Proper encoding:
http://192.168.178.45:7478/Samurai,%20%231)-Ravensburger%20Buchverlag%20(2011).epub

The second variant (replacing # with %23 works).

Something seems to be going wrong here, because I used encodeURIComponent to generate the correct url.

Nunjucks

What do you think if we added Nunjucks template engine to the app?
I believe it would help display information on the screen, since we will not depend on the browser's way of showing folders/files. I did an implementation in my fork. Take a look!
P.S: commits after Oct 7 are not there yet, but if you find it useful I will rebase and create a PR

Directory will be cached even the directory has been changed.

Thanks for sharing the sharing tool!
I met the issue that the directory will be cached even the directory has been changed.

For example:

sharing ./my-first-directotry

The url link will look like http://192.168.2.123:7478 which is working fine at the first time by using my phone via the QR.
Then I would like to change another directory of mine.

sharing ./my-another-directotry

The generated link is completely the same with previous one like http://192.168.2.123:7478, I scan the QR and got the same directory with before.

Solution:

  1. Clear the cache on my phone, use another browser or use Incognito mode(I would say it's a little boring sometimes).
  2. Generate the unique link if directory has been changed(query string like ?time=xxx will be fine)

node:os package missing.

Getting node:os package missing. Tried adding this package globally "node:os" don't work. I've added "os" and still getting same error:

Screenshot 2022-10-06 09 34 11

Ideally, all dependencies should be installed with original npm install command (isn't that the point?).

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.