0.6.0 • Published 3 years ago

fs-extra-plus v0.6.0

Weekly downloads
243
License
MIT
Repository
github
Last release
3 years ago

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

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.
}
0.6.0

3 years ago

0.5.23

3 years ago

0.5.22

3 years ago

0.5.21

4 years ago

0.5.20

4 years ago

0.5.19

4 years ago

0.5.18

5 years ago

0.5.17

5 years ago

0.5.16

5 years ago

0.5.15

5 years ago

0.5.14

5 years ago

0.5.13

5 years ago

0.5.12

5 years ago

0.5.11

5 years ago

0.5.10

5 years ago

0.5.9

5 years ago

0.5.8

5 years ago

0.5.7

5 years ago

0.5.6

6 years ago

0.5.5

6 years ago

0.5.3

6 years ago

0.5.2

6 years ago

0.5.1

6 years ago

0.5.0

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.5

7 years ago

0.3.4

7 years ago

0.3.3

7 years ago

0.3.2

7 years ago

0.3.1

7 years ago

0.3.0

7 years ago

0.2.3

7 years ago

0.2.2

7 years ago

0.2.1

7 years ago

0.2.0

7 years ago

0.1.3

7 years ago

0.1.2

7 years ago

0.1.1

8 years ago

0.1.0

8 years ago