# hidefile

> Hide files and directories on all platforms.

Latest version **4.0.0** (published 2026-09-01) · MIT license · 0 weekly downloads

## Install

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

## Health

**Score 70/100 (B)** — status: active.

Positive: has types; esm support; no vulnerabilities; recently updated; high maintenance score; high quality score.

Warnings: low downloads.

## Facts

| | |
|---|---|
| Version | 4.0.0 |
| Published | 2026-09-01 |
| First published | 2014-08-02 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM |
| Node | >= 24 |
| Dependencies | 2 |
| Unpacked size | 15.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 28 |
| Author | Steven Vachon |
| Maintainers | stevenvachon |
| Keywords | directory, dotfile, file, folder, fs, hidden, hide, native, windows |

## Links

- npm: https://www.npmjs.com/package/hidefile
- Repository: https://github.com/stevenvachon/hidefile
- Homepage: https://github.com/stevenvachon/hidefile#readme
- Issues: https://github.com/stevenvachon/hidefile/issues
- npm.io page: https://npm.io/package/hidefile

## Dependencies (2)

- [winattr](https://npm.io/package/winattr.md) ^4.0.0
- [is-windows](https://npm.io/package/is-windows.md) ^1.0.2

## Alternatives

- [unionfs](https://npm.io/package/unionfs.md) — 2.2M weekly downloads
- [path-starts-with](https://npm.io/package/path-starts-with.md) — 35.9K weekly downloads
- [redzip](https://npm.io/package/redzip.md) — 1.2K weekly downloads
- [vscode-anymatch](https://npm.io/package/vscode-anymatch.md) — 848 weekly downloads
- [@ledgerhq/coin-filecoin](https://npm.io/package/@ledgerhq/coin-filecoin.md) — 793 weekly downloads

## Recent versions

- 4.0.0 (latest) — 2026-09-01
- 4.0.0-rc2 (rc2) — 2026-09-01
- 4.0.0-rc (rc) — 2026-09-01
- 3.0.0 — 2019-04-23
- 2.0.0 — 2016-11-02
- 1.1.0 — 2015-09-16
- 1.0.0 — 2015-06-09
- 0.2.0 — 2014-08-21
- 0.1.2 — 2014-08-15
- 0.1.1 — 2014-08-12
- 0.1.0 — 2014-08-02

## README

# hidefile [![NPM Version][npm-image]][npm-url] ![Build Status][ghactions-image] [![Coverage Status][codecov-image]][codecov-url]

> Hide files and directories on all platforms.

Unix:

- Adds or removes a "." prefix on a file or directory.

Windows:

- Adds or removes a "." prefix on a file or directory.
- Adds or removes the "hidden" attribute on a file or directory.

A native binding is used, offering great performance. As a contingency in case that fails, functionality will silently revert to a command line, though it is considerably slower.

## Install

```shell
npm install hidefile
```

## Usage

### Basic

```js
import { hide, hideSync, reveal, revealSync } from 'hidefile';

await hide('path/to/file.ext'); //-> 'path/to/.file.ext'
hideSync('path/to/file.ext'); //-> 'path/to/.file.ext'

await reveal('path/to/.file.ext'); //-> 'path/to/file.ext'
revealSync('path/to/.file.ext'); //-> 'path/to/file.ext'
```

### Predicates

```js
import {
  isDotPrefixed,
  isHidden,
  isHiddenSync,
  shouldBeHidden,
  shouldBeHiddenSync,
} from 'hidefile';

isDotPrefixed('path/to/.file.ext'); //-> true
isDotPrefixed('path/to/file.ext'); //-> false

/*
  Unix: prefixed
  Windows: prefixed _and_ attributed
*/
await isHidden('path/to/.file.ext'); //-> true
isHiddenSync('path/to/.file.ext'); //-> true

/*
  Unix: prefixed
  Windows: prefixed _or_ attributed
*/
await shouldBeHidden('path/to/.file.ext'); //-> true
shouldBeHiddenSync('path/to/.file.ext'); //-> true
```

[npm-image]: https://img.shields.io/npm/v/hidefile
[npm-url]: https://npmjs.com/package/hidefile
[ghactions-image]: https://img.shields.io/github/actions/workflow/status/stevenvachon/hidefile/test.yml
[codecov-image]: https://img.shields.io/codecov/c/github/stevenvachon/hidefile
[codecov-url]: https://app.codecov.io/github/stevenvachon/hidefile

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