removedrive

Safely remove a drive on Windows

Usage no npm install needed!

<script type="module">
  import removedrive from 'https://cdn.skypack.dev/removedrive';
</script>

README

removedrive

npm version dependencies Build status

Safely remove a drive on Windows.

Installation

Install removedrive by running:

$ npm install --save removedrive

Documentation

removedrive.eject(driveLetter, callback)

Running this function requires administration permissions.

Kind: static method of removedrive
Summary: Eject a drive by it's letter or identifier
Access: public

Param Type Description
driveLetter String drive letter
callback function callback (error)

Example

removedrive.eject('D', function(error) {
  if (error) throw error;
});

Example

removedrive.eject('\\\\.\\PHYSICALDRIVE2', function(error) {
  if (error) throw error;
});

Support

If you're having any problem, please raise an issue on GitHub and the jviotti team will be happy to help.

Tests

Run the test suite by doing:

$ gulp test

Contribute

Before submitting a PR, please make sure that you include tests, and that jshint runs without any warning:

$ gulp lint

License

The project is licensed under the MIT license.