Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

node-mtp

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-mtp

Access devices over MTP using Node.js

  • 0.3.18
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
19
increased by35.71%
Maintainers
1
Weekly downloads
 
Created
Source

node-mtp

Access devices over MTP using Node.js

Introduction

On some operating systems (e.g. macOS) devices like modern Android phones do not mount as disk drives without using external software, like Android File Transfer or OSXFUSE. node-mtp allows Node.js (v10 or higher) and Electron apps (v3.0.0 or higher) to read files from devices over MTP without requiring additional software or drivers.

node-mtp is an N-API wrapper around the libmtp library. It uses version 3 of N-API which is only available on Node v10 and higher.

Usage

const mtp = require('node-mtp');

mtp.attach();

const list = mtp.getFileListing();
console.log('Files:', list);

mtp.getFile(8, 'test.jpg'); // <file id>, <destination>

mtp.release();

Building

To build this on your own machine, you'll need libmtp:

  • Ubuntu: sudo apt-get install libmtp-dev
  • macOS: brew install libmtp

Updating on Yarn/NPM

The following steps will update the module on Yarn/NPM:

  • yarn version
  • git push && git push --tags
  • Wait for Travis to finish.
  • Download the releases from Github: prebuildify-ci download
  • npm publish

Note that you need to yarn global add prebuildify-ci to get the prebuilds.

Keywords

FAQs

Package last updated on 09 Jun 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc