# denymount

> Prevent disks from mounting in OS X

Latest version **2.3.0** (published 2019-05-10) · Apache-2.0 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install denymount
pnpm add denymount
yarn add denymount
bun add denymount
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 2.3.0 |
| Published | 2019-05-10 |
| First published | 2016-03-22 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 42.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Akis Kesoglou |
| Maintainers | balena.io |
| Keywords | deny, mount, drive, prevent |

## Links

- npm: https://www.npmjs.com/package/denymount
- Repository: https://github.com/resin-io-modules/denymount
- Issues: https://github.com/resin-io-modules/denymount/issues
- npm.io page: https://npm.io/package/denymount

## Dependencies (2)

- [async](https://npm.io/package/async.md) ^2.0.0-rc.2
- [macmount](https://npm.io/package/macmount.md) ^1.0.0

## Alternatives

- [async-exit-hook](https://npm.io/package/async-exit-hook.md) — 3.7M weekly downloads
- [evnty](https://npm.io/package/evnty.md) — 7.2K weekly downloads
- [eleventy-plugin-asciidoc](https://npm.io/package/eleventy-plugin-asciidoc.md) — 3.5K weekly downloads
- [@jswork/next-get2get](https://npm.io/package/@jswork/next-get2get.md) — 945 weekly downloads
- [@dashersw/axon](https://npm.io/package/@dashersw/axon.md) — 934 weekly downloads

## Recent versions

- 2.3.0 (latest) — 2019-05-10
- 2.3.0-7-executable-path-option-2d1f944a481b64ea672a31927839288addccc067 — 2019-05-09
- 2.3.0-7-executable-path-option-ad65e8ee5e64aafdc30fd406ff82ff618a7d7a9e — 2019-05-09
- 2.2.0 — 2016-03-31
- 2.1.0 — 2016-03-29
- 2.0.0 — 2016-03-24
- 1.0.0 — 2016-03-22

## README

denymount
=========

> Node.js library to prevent automatic mounting of specific disks on Mac OS X. For Mac OS X >= 10.9.

[![npm version](https://badge.fury.io/js/denymount.svg)](http://badge.fury.io/js/denymount)
[![dependencies](https://david-dm.org/resin-io-modules/denymount.svg)](https://david-dm.org/resin-io-modules/denymount.svg)
[![Build Status](https://travis-ci.org/resin-io-modules/denymount.svg?branch=master)](https://travis-ci.org/resin-io-modules/denymount)

Installation
------------

Install `denymount` by running:

```sh
$ npm install --save denymount
```

Documentation
-------------

<a name="module_denymount..denymount"></a>

### denymount~denymount(disk, handler, [options], callback)
**Kind**: inner method of <code>[denymount](#module_denymount)</code>  
**Summary**: Prevent automatic mounting of an OS X disk  
**Access:** public  

| Param | Type | Default | Description |
| --- | --- | --- | --- |
| disk | <code>String</code> |  | disk |
| handler | <code>function</code> |  | handler (callback) |
| [options] | <code>Object</code> |  | options |
| [options.autoMountOnSuccess] | <code>Boolean</code> | <code>false</code> | auto-mount on success |
| [options.executablePath] | <code>String</code> |  | alternative path to the `denymount` binary executable invoked at runtime |
| callback | <code>function</code> |  | callback (error) |

**Example**  
```js
denymount('/dev/disk2', function(callback) {
  console.log('While this code runs, /dev/disk2 is ensured to not be auto-mounted');
  return callback(null, 'foo');
}, {
  autoMountOnSuccess: true
}, function(error, message) {
  if (error) {
    throw error;
  }

  console.log(message);
});
```

Tests
-----

Run the test suite by doing:

```sh
$ npm test
```

Development
-----------

`denymount` wraps a native command line utility that must be built with Xcode 7.

If you make edits to the executable source make sure to build it afterwards with:

```sh
$ npm run build
```

This will build and place the compiled executable in the *bin* folder.

The command line utility can be used directly as follows:

```sh
$ ./bin/denymount diskName
```

The programme will keep running until you hit `ctrl+C` (or `SIGINT`/`SIGTERM` if sent to background).

Contribute
----------

- Issue Tracker: [github.com/resin-io-modules/denymount/issues](https://github.com/resin-io-modules/denymount/issues)
- Source Code: [github.com/resin-io-modules/denymount](https://github.com/resin-io-modules/denymount)

Support
-------

If you're having any problem, please [raise an issue](https://github.com/resin-io-modules/denymount/issues/new)
on GitHub and the Resin.io team will be happy to help.

License
-------

*denymount* is free software, and may be redistributed under the terms specified
in the [license](https://github.com/resin-io-modules/denymount/blob/master/LICENSE).

---
_Source: https://npm.io/package/denymount · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
