Latest Threat Research:Malicious dYdX Packages Published to npm and PyPI After Maintainer Compromise.Details
Socket
Book a DemoInstallSign in
Socket

reset-usb

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

reset-usb

reset a usb device on linux with ioctl

Source
npmnpm
Version
0.0.0
Version published
Maintainers
1
Created
Source

reset-usb

reset a usb device. simulate plug/unplug.

var reset = require("reset-usb")

reset('/dev/bus/usb/002/007',function(err,data){
  console.log(err,data);
  if(!err) console.log('success!');
})

you can also specify the path to a usb serial tty device and ```tty-to-usb-device`` will find it for you.


var reset = require("reset-usb")
reset('/dev/ttyACM0',function(err,data){
  console.log(err,data);
  if(!err) console.log('success!');
})


and the bad news.

  • requires linux. ioctls are supported in different ways cross platform. it would be nice for this to work on osx.
  • requires sudo. usb devices are owned by root. you have to be root to restart them =(

FAQs

Package last updated on 05 Nov 2014

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