fs-extra-plus
A extension of fs-extra with .glob(), .saferRemove()
Last updated 2 months ago by jeremychone .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install fs-extra-plus 
SYNC missed versions from official npm registry.

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

Current Tags

  • 0.5.16                                ...           latest (2 months ago)

32 Versions

  • 0.5.16                                ...           2 months ago
  • 0.5.15                                ...           4 months ago
  • 0.5.14                                ...           5 months ago
  • 0.5.13                                ...           6 months ago
  • 0.5.12                                ...           6 months ago
  • 0.5.11                                ...           7 months ago
  • 0.5.10                                ...           8 months ago
  • 0.5.9                                ...           10 months ago
  • 0.5.8                                ...           a year ago
  • 0.5.7                                ...           a year ago
  • 0.5.6                                ...           a year ago
  • 0.5.5                                ...           a year ago
  • 0.5.3                                ...           a year ago
  • 0.5.2                                ...           2 years ago
  • 0.5.1                                ...           2 years ago
  • 0.5.0                                ...           2 years ago
  • 0.4.1                                ...           2 years ago
  • 0.4.0                                ...           2 years ago
  • 0.3.5                                ...           2 years ago
  • 0.3.4                                ...           2 years ago
  • 0.3.3                                ...           2 years ago
  • 0.3.2                                ...           2 years ago
  • 0.3.1                                ...           2 years ago
  • 0.3.0                                ...           2 years ago
  • 0.2.3                                ...           2 years ago
  • 0.2.2                                ...           2 years ago
  • 0.2.1                                ...           2 years ago
  • 0.2.0                                ...           2 years ago
  • 0.1.3                                ...           3 years ago
  • 0.1.2                                ...           3 years ago
  • 0.1.1                                ...           3 years ago
  • 0.1.0                                ...           3 years ago
Maintainers (1)
Downloads
Today 26
This Week 55
This Month 55
Last Day 29
Last Week 99
Last Month 585
Dependencies (3)
Dev Dependencies (4)

Copyright 2014 - 2016 © taobao.org |