Skip to content

Commit

Permalink
BREAKING: Drop Node 8 support
Browse files Browse the repository at this point in the history
Use the new fs.mkdir {recursive: true} option instead of the mkdirp dependency.

It might be too early to merge this, since Node 8 is still supported until the end of the 2019. But just sending this PR so we can merge it at some point in the future.

For: brave/brave-browser#5490
  • Loading branch information
feross committed Aug 7, 2019
1 parent 7eeb5a5 commit 6b71f9c
Show file tree
Hide file tree
Showing 4 changed files with 2 additions and 6 deletions.
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,5 @@ os:
- osx
- windows
node_js:
- '8'
- '10'
- node
3 changes: 1 addition & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
var inherits = require('util').inherits
var RandomAccess = require('random-access-storage')
var fs = require('fs')
var mkdirp = require('mkdirp')
var path = require('path')
var constants = fs.constants || require('constants')

Expand Down Expand Up @@ -35,7 +34,7 @@ inherits(RandomAccessFile, RandomAccess)
RandomAccessFile.prototype._open = function (req) {
var self = this

mkdirp(path.dirname(this.filename), ondir)
fs.mkdir(path.dirname(this.filename), { recursive: true }, ondir)

function ondir (err) {
if (err) return req.callback(err)
Expand Down
1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@
},
"browser": "./browser.js",
"dependencies": {
"mkdirp": "^0.5.1",
"random-access-storage": "^1.1.1"
},
"devDependencies": {
Expand Down
3 changes: 1 addition & 2 deletions test.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,12 @@ var tape = require('tape')
var os = require('os')
var path = require('path')
var fs = require('fs')
var mkdirp = require('mkdirp')
var isWin = process.platform === 'win32'

var tmp = path.join(os.tmpdir(), 'random-access-file-' + process.pid + '-' + Date.now())
var i = 0

mkdirp.sync(tmp)
fs.mkdirSync(tmp, { recursive: true })

tape('write and read', function (t) {
var file = raf(gen())
Expand Down

0 comments on commit 6b71f9c

Please sign in to comment.