# fs-extra-plus

> A extension of fs-extra with .glob(), .saferRemove()

Latest version **0.6.0** (published 2021-11-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install fs-extra-plus
pnpm add fs-extra-plus
yarn add fs-extra-plus
bun add fs-extra-plus
```

## Health

**Score 30/100 (F)** — status: abandoned.

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

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.0 |
| Published | 2021-11-30 |
| First published | 2017-05-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=8.0.0 |
| Dependencies | 3 |
| Unpacked size | 9.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 5 |
| Author | Jeremy Chone |
| Maintainers | jeremychone |
| Keywords | fs, file, fs-extra, list files, watch |

## Links

- npm: https://www.npmjs.com/package/fs-extra-plus
- Repository: https://github.com/BriteSnow/node-fs-extra-plus
- Homepage: https://github.com/BriteSnow/node-fs-extra-plus#readme
- Issues: https://github.com/BriteSnow/node-fs-extra-plus/issues
- npm.io page: https://npm.io/package/fs-extra-plus

## Dependencies (3)

- [fs-extra](https://npm.io/package/fs-extra.md) ^10.0.0
- [fast-glob](https://npm.io/package/fast-glob.md) ^3.2.7
- [@types/fs-extra](https://npm.io/package/@types/fs-extra.md) ^9.0.13

## 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

- 0.6.0 (latest) — 2021-11-30
- 0.5.23 — 2021-11-27
- 0.5.22 — 2021-06-25
- 0.5.21 — 2021-02-15
- 0.5.20 — 2020-11-04
- 0.5.19 — 2020-08-31
- 0.5.18 — 2020-06-15
- 0.5.17 — 2020-06-06
- 0.5.16 — 2020-04-08
- 0.5.15 — 2020-02-07
- 0.5.14 — 2020-01-10
- 0.5.13 — 2019-12-17
- 0.5.12 — 2019-11-26
- 0.5.11 — 2019-10-18
- 0.5.10 — 2019-09-19
- … 25 more at https://npm.io/package/fs-extra-plus/versions

## README

`fs-extra` + `.glob()` (fast-glob) + `.saferRemove()` (from basedir by default)



### Changelogs

- 0.3.0: Simplified, and completely re-written. Just focused on what we often add on top of fs-extra. Right now, just `.glob()` (fast-glob) and `.saferRemove()`


### example

```ts
import * as fs from 'fs-extra-plus';


async function example(){

  // can use the normal fs-extra function
  await fs.ensureDir('/tmp/my-temp/');
  await fs.copy('/tmp/myfile', '/tmp/my-temp/mynewfile')

  // fs-extra-plus glob (using fast-glob)
  const files = await fs.glob('**/*.js');

  const files = await fs.glob(['**/*.js', '**/*.css'], 'src/'); 
  // Note that when cwd, the return files will have the cwd in the path
  // e.g., files[0] === 'src/some.ts' (and not as 'some.ts' as in raw fast-glob)
  
  // or full fast-glob options 
  const files = await fs.glob(['**/*.js', '**/*.css'], {cwd: 'src/', deep: 3});
  
  // fs-extra-plus saferRemove
  fs.saferRemove('../somedir'); // >> Throw error, seems not safe, does not belong to current dir
  fs.saferRemove('/etc/'); // >> Throw error, seems not safe, does not belong to current dir
  fs.saferRemove('some-file-in-basedir'); // >> will delete
  fs.saferRemove(['some-dir/some-file'],'/tmp/'); // >> will delete `some-dir/some-file` from the `/tmp/` dir.
}

```

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