Skip to content
Permalink

Comparing changes

Choose two branches to see what’s changed or to start a new pull request. If you need to, you can also or learn more about diff comparisons.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also . Learn more about diff comparisons here.
base repository: jprichardson/node-fs-extra
Failed to load repositories. Confirm that selected base ref is valid, then try again.
Loading
base: 7b12b058e27df560ba777756f38f977662c23750
Choose a base ref
...
head repository: jprichardson/node-fs-extra
Failed to load repositories. Confirm that selected head ref is valid, then try again.
Loading
compare: 1625838cdfc65a1bbf28ab5fa962a75805629b9c
Choose a head ref
  • 5 commits
  • 7 files changed
  • 4 contributors

Commits on Jun 17, 2020

  1. Copy the full SHA
    96facaa View commit details

Commits on Jul 29, 2020

  1. Upgrade universalify (#825)

    No breaking changes for us, just performance improvements
    RyanZim authored Jul 29, 2020
    Copy the full SHA
    6bffcd8 View commit details

Commits on Jan 19, 2021

  1. Add promise support for fs.rm() (#860)

    Fixes #841
    RyanZim authored Jan 19, 2021
    Copy the full SHA
    d409cf8 View commit details
  2. Copy the full SHA
    76d38fc View commit details
  3. 9.1.0

    RyanZim committed Jan 19, 2021
    Copy the full SHA
    1625838 View commit details
Showing with 47 additions and 6 deletions.
  1. +6 −0 CHANGELOG.md
  2. +3 −0 README.md
  3. +2 −2 lib/copy-sync/__tests__/copy-sync-dir.test.js
  4. +2 −2 lib/copy/__tests__/copy.test.js
  5. +30 −0 lib/fs/__tests__/rm.test.js
  6. +2 −0 lib/fs/index.js
  7. +2 −2 package.json
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
9.1.0 / 2021-01-19
------------------

- Add promise support for `fs.rm()` ([#841](https://github.com/jprichardson/node-fs-extra/issues/841), [#860](https://github.com/jprichardson/node-fs-extra/pull/860))
- Upgrade universalify for performance improvments ([#825](https://github.com/jprichardson/node-fs-extra/pull/825))

9.0.1 / 2020-06-03
------------------

3 changes: 3 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -153,6 +153,9 @@ They were removed from `fs-extra` in v2.0.0. If you need the functionality, `wal
Third Party
-----------

### CLI

[fse-cli](https://www.npmjs.com/package/@atao60/fse-cli) allows you to run `fs-extra` from a console or from [npm](https://www.npmjs.com) scripts.

### TypeScript

4 changes: 2 additions & 2 deletions lib/copy-sync/__tests__/copy-sync-dir.test.js
Original file line number Diff line number Diff line change
@@ -182,7 +182,7 @@ describe('+ copySync() / dir', () => {
it('should apply filter when it is applied only to dest', done => {
const timeCond = new Date().getTime()

const filter = (s, d) => fs.statSync(d).birthtime.getTime() < timeCond
const filter = (s, d) => fs.statSync(d).mtime.getTime() < timeCond

const dest = path.join(TEST_DIR, 'dest')

@@ -197,7 +197,7 @@ describe('+ copySync() / dir', () => {

it('should apply filter when it is applied to both src and dest', done => {
const timeCond = new Date().getTime()
const filter = (s, d) => s.split('.').pop() !== 'css' && fs.statSync(path.dirname(d)).birthtime.getTime() > timeCond
const filter = (s, d) => s.split('.').pop() !== 'css' && fs.statSync(path.dirname(d)).mtime.getTime() > timeCond

const dest = path.join(TEST_DIR, 'dest')

4 changes: 2 additions & 2 deletions lib/copy/__tests__/copy.test.js
Original file line number Diff line number Diff line change
@@ -366,7 +366,7 @@ describe('fs-extra', () => {
it('should apply filter when it is applied only to dest', done => {
const timeCond = new Date().getTime()

const filter = (s, d) => fs.statSync(d).birthtime.getTime() < timeCond
const filter = (s, d) => fs.statSync(d).mtime.getTime() < timeCond

const src = path.join(TEST_DIR, 'src')
fse.mkdirsSync(src)
@@ -388,7 +388,7 @@ describe('fs-extra', () => {

it('should apply filter when it is applied to both src and dest', done => {
const timeCond = new Date().getTime()
const filter = (s, d) => s.split('.').pop() !== 'css' && fs.statSync(path.dirname(d)).birthtime.getTime() > timeCond
const filter = (s, d) => s.split('.').pop() !== 'css' && fs.statSync(path.dirname(d)).mtime.getTime() > timeCond

const dest = path.join(TEST_DIR, 'dest')
setTimeout(() => {
30 changes: 30 additions & 0 deletions lib/fs/__tests__/rm.test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
'use strict'

const fse = require('../..')
const os = require('os')
const path = require('path')
const assert = require('assert')
const atLeastNode = require('at-least-node')

/* eslint-env mocha */

// Used for tests on Node 14.14.0+ only
const describeNode14 = atLeastNode('14.14.0') ? describe : describe.skip

describeNode14('fs.rm', () => {
let TEST_FILE

beforeEach(done => {
TEST_FILE = path.join(os.tmpdir(), 'fs-extra', 'fs-rm')
fse.remove(TEST_FILE, done)
})

afterEach(done => fse.remove(TEST_FILE, done))

it('supports promises', () => {
fse.writeFileSync(TEST_FILE, 'hello')
return fse.rm(TEST_FILE).then(() => {
assert(!fse.pathExistsSync(TEST_FILE))
})
})
})
2 changes: 2 additions & 0 deletions lib/fs/index.js
Original file line number Diff line number Diff line change
@@ -31,6 +31,7 @@ const api = [
'readlink',
'realpath',
'rename',
'rm',
'rmdir',
'stat',
'symlink',
@@ -41,6 +42,7 @@ const api = [
].filter(key => {
// Some commands are not available on some systems. Ex:
// fs.opendir was added in Node.js v12.12.0
// fs.rm was added in Node.js v14.14.0
// fs.lchown is not available on at least some Linux
return typeof fs[key] === 'function'
})
4 changes: 2 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "fs-extra",
"version": "9.0.1",
"version": "9.1.0",
"description": "fs-extra contains methods that aren't included in the vanilla Node.js fs package. Such as recursive mkdir, copy, and remove.",
"engines": {
"node": ">=10"
@@ -40,7 +40,7 @@
"at-least-node": "^1.0.0",
"graceful-fs": "^4.2.0",
"jsonfile": "^6.0.1",
"universalify": "^1.0.0"
"universalify": "^2.0.0"
},
"devDependencies": {
"coveralls": "^3.0.0",