# mountutils

> Cross platform mount related utilities

Latest version **2.0.8** (published 2026-08-25) · Apache-2.0 license · 0 weekly downloads

## Install

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

## Health

**Score 50/100 (C)** — status: active.

Positive: no vulnerabilities; has provenance; recently updated; high maintenance score.

Warnings: low downloads; no types; no esm support.

Negative: declining downloads.

## Facts

| | |
|---|---|
| Version | 2.0.8 |
| Published | 2026-08-25 |
| First published | 2017-03-23 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Node | >18 <=24 |
| Dependencies | 4 |
| Unpacked size | 90.9 KB |
| Known vulnerabilities | 0 |
| Install scripts | yes |
| Provenance | attested (GitHub Actions) |
| GitHub stars | 7 |
| Author | Juan Cruz Viotti |
| Maintainers | balena.io |
| Keywords | mount, utils, unmount, unmounDisk, cross, platform |

## Links

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

## Dependencies (4)

- [nan](https://npm.io/package/nan.md) ^2.22.0
- [bindings](https://npm.io/package/bindings.md) ^1.3.0
- [prebuildify](https://npm.io/package/prebuildify.md) ^6.0.1
- [node-gyp-build](https://npm.io/package/node-gyp-build.md) ^4.8.4

## Alternatives

- [mobx-react](https://npm.io/package/mobx-react.md) — 2.8M weekly downloads
- [rc-tree](https://npm.io/package/rc-tree.md) — 2.6M weekly downloads
- [@react-oauth/google](https://npm.io/package/@react-oauth/google.md) — 1.3M weekly downloads
- [@wagmi/connectors](https://npm.io/package/@wagmi/connectors.md) — 877.0K weekly downloads
- [vee-validate](https://npm.io/package/vee-validate.md) — 836.4K weekly downloads

## Recent versions

- 2.0.8 (latest) — 2026-08-25
- 2.0.9-build-renovate-mocha-12-x-5fb35ce9cf6f2ebf367c142ae5601a1702554581-1 (build-renovate-mocha-12-x) — 2026-09-12
- 2.0.9-build-renovate-major-10-eslint-monorepo-700488a667d2983a00ba3bdef512a1fc41ad89d7-1 (build-renovate-major-10-eslint-monorepo) — 2026-09-07
- 2.0.9-build-renovate-cpplint-2-x-bc14bf164b643cd02d7612106f3a9931985e6926-1 (build-renovate-cpplint-2-x) — 2026-08-25
- 2.0.8-build-renovate-flowzonify-0-x-f504790f1ffccbf65d6d660ca33a8e0fc48ba86f-1 (build-renovate-flowzonify-0-x) — 2026-08-25
- 2.0.7-build-renovate-mocha-11-x-09ea373fac9cbce4a6a642e7d9a1157ac75985c4-1 (build-renovate-mocha-11-x) — 2026-08-08
- 2.0.6-build-renovate-patch-eslint-monorepo-4945c8fa7adc4b037d13cabc4665d14b196f6015-1 (build-renovate-patch-eslint-monorepo) — 2026-07-18
- 2.0.5-build-renovate-mocha-11-7-x-a8cd7d398f49da0b34ab7bb5a220012831a9cb0f-1 (build-renovate-mocha-11-7-x) — 2026-07-04
- 2.0.4-build-renovate-chai-6-x-82476c8e564f94403c9fa0d7343f301e43179893-1 (build-renovate-chai-6-x) — 2026-05-16
- 2.0.3-build-renovate-pin-dependencies-8a1bd333bb53689de4c34bf063937b1af9a413af-1 (build-renovate-pin-dependencies) — 2026-05-16
- 2.0.3-build-renovate-major-6-chai-ee2771710310b29d1429cda388f50c4358c95108-1 (build-renovate-major-6-chai) — 2026-02-19
- 2.0.3-build-renovate-major-10-eslint-d79b2ff58fce9043bea6338418c6f89eb1d18a0e-1 (build-renovate-major-10-eslint) — 2026-02-19
- 2.0.2-build-add-npm-oidc-permissions-1bceab884b4c4cde3a264387002acec68917efcc-1 (build-add-npm-oidc-permissions) — 2026-02-19
- 2.0.1-build-renovate-cpplint-1-x-eea69b778bdaa3c0d224392dd0f8705fb480d7e1-1 (build-renovate-cpplint-1-x) — 2025-05-29
- 2.0.0-build-aethernet-node22-8bd3e50e2fafccb224b408879c70db3c0c0ba92d-1 (build-aethernet-node22) — 2025-05-29
- … 93 more at https://npm.io/package/mountutils/versions

## README

# mountutils

[![npm](https://img.shields.io/npm/v/mountutils.svg?style=flat-square)](https://npmjs.com/package/mountutils)
[![npm license](https://img.shields.io/npm/l/mountutils.svg?style=flat-square)](https://npmjs.com/package/mountutils)
[![npm downloads](https://img.shields.io/npm/dm/mountutils.svg?style=flat-square)](https://npmjs.com/package/mountutils)

> Cross platform mount related utilities

## Installation

Install `mountutils` by running:

```sh
$ npm install --save mountutils
```

## Prebuild

This project contains cross-platform prebuild

## Debug mode

You can enable debug mode by setting the `MOUNTUTILS_DEBUG` environment
variable.

## Documentation

<a name="module_mountutils.unmountDisk"></a>

### mountutils.unmountDisk(device, callback)

**Kind**: static method of <code>[mountutils](#module_mountutils)</code>  
**Summary**: Unmount a whole disk  
**Access**: public

| Param    | Type                  | Description      |
| -------- | --------------------- | ---------------- |
| device   | <code>String</code>   | device           |
| callback | <code>function</code> | callback (error) |

**Example**

```js
// macOS
const drive = "/dev/disk2";

// GNU/Linux
const drive = "/dev/sdb";

// Windows
const drive = "\\\\.\\PHYSICALDRIVE2";

mountutils.unmountDisk(drive, (error) => {
  if (error) {
    throw error;
  }

  console.log("Done!");
});
```

## Support

If you're having any problem, please [raise an issue][newissue] on GitHub and
the balena.io team will be happy to help.

## Tests

Run the test suite by doing:

```sh
$ npm test
```

## Troubleshooting

### `error C2373: '__pfnDliNotifyHook2': redefinition`

This error indicates that the version of npm you're running is too old. Upgrade
by running:

```sh
npm install -g npm@latest
```

See the [following `node-gyp` issue](https://github.com/nodejs/node-gyp/issues/972) for more details.



### ```ModuleNotFoundError: No module named 'distutils'`

Your version of python is too recent for node-gyp to work;
Use a version <= 3.11 and it should work.

## Contribute

- Issue Tracker: [github.com/balena-io-modules/mountutils/issues][issues]
- Source Code: [github.com/balena-io-modules/mountutils][source]

### Dependencies

- [cpplint][cpplint]

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

```sh
$ npm run lint
```

## License

The project is licensed under the Apache 2.0 license.

[issues]: https://github.com/balena-io-modules/mountutils/issues
[newissue]: https://github.com/balena-io-modules/mountutils/issues/new
[source]: https://github.com/balena-io-modules/mountutils
[cpplint]: https://github.com/cpplint/cpplint

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