Skip to content

ganeshrvel/mtp-nodejs-port-native-addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

MTP Kernel for Node.js - Native addon

Introduction

MTP Kernel for Node.js

Access Android phones and other MTP devices using Node.js. This project uses N-API wrapper around the libmtp library. It uses version 3 of N-API which is only available on Node.js v10 and higher.

Features

  • Upload file to MTP
  • Download file from MTP
  • Get MTP file tree
  • Create MTP folder
  • Rename MTP file
  • Delete MTP file

Building from Source

Requirements: Node.js v10, Git, Yarn package manager, libmtp and Homebrew for mac

Install dependencies

# Ubuntu
sudo apt-get install libmtp-dev
	
# macOS
brew install libmtp

Clone

$ git clone --depth 1 --single-branch --branch master https://github.com/ganeshrvel/mtp-nodejs-port-native-addon.git

$ cd mtp-nodejs-port-native-addon
$ yarn

Build

$ yarn run build-node-gyp

Run

Find usage examples in test.js

$ node test.js

// to refresh the MTP
$ node test.js resetmtp

More repos

Accolades and Credits

Contribute

  • Fork the repo and create your branch from master.
  • Ensure that the changes pass linting.
  • Update the documentation if needed.
  • Make sure your code lints.
  • Issue a pull request!

When you submit code changes, your submissions are understood to be under the same MIT License that covers the project. Feel free to contact the maintainers if that's a concern.

Buy me a coffee

Help me keep the app FREE and open for all. Paypal me: paypal.me/ganeshrvel

Contacts

Please feel free to contact me at ganeshrvel@outlook.com

License

MTP Port for node.js - Native addon is released under MIT License.

Copyright © 2018-Present Ganesh Rathinavel