Skip to content
This repository has been archived by the owner on Aug 11, 2021. It is now read-only.

Commit

Permalink
dep: remove mkdirp dependency
Browse files Browse the repository at this point in the history
* dep: mkdirp hasn't been updated in 4 years, and node's fs library
has had a recursive option for `fs` since v10.12 (oldest active LTS
version). Additionally `mkdirp` depends on a version of library `minimist` that has a minor vulnerability associated.

Refs:
* https://nodejs.org/api/fs.html#fs_fs_mkdir_path_options_callback
* https://npmjs.com/advisories/1179
  • Loading branch information
rharriso committed Mar 30, 2020
1 parent 4235459 commit 8ceb5e8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
4 changes: 2 additions & 2 deletions lib/dir-writer.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@
module.exports = DirWriter

var Writer = require('./writer.js')
var nodeFs = require('fs')
var inherits = require('inherits')
var mkdir = require('mkdirp')
var path = require('path')
var collect = require('./collect.js')

Expand All @@ -31,7 +31,7 @@ function DirWriter (props) {

DirWriter.prototype._create = function () {
var self = this
mkdir(self._path, Writer.dirmode, function (er) {
nodeFs.mkdir(self._path, { recursive: true }, function (er) {
if (er) return self.error(er)
// ready to start getting entries!
self.ready = true
Expand Down
4 changes: 2 additions & 2 deletions lib/writer.js
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
module.exports = Writer

var nodeFs = require('fs')
var fs = require('graceful-fs')
var inherits = require('inherits')
var rimraf = require('rimraf')
var mkdir = require('mkdirp')
var path = require('path')
var umask = process.platform === 'win32' ? 0 : process.umask()
var getType = require('./get-type.js')
Expand Down Expand Up @@ -166,7 +166,7 @@ function create (self) {

// XXX Need to clobber non-dirs that are in the way,
// unless { clobber: false } in the props.
mkdir(path.dirname(self._path), Writer.dirmode, function (er, made) {
nodeFs.mkdir(path.dirname(self._path), { recursive: true }, function (er, made) {
// console.error("W created", path.dirname(self._path), er)
if (er) return self.error(er)

Expand Down
6 changes: 5 additions & 1 deletion package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@
"dependencies": {
"graceful-fs": "^4.1.2",
"inherits": "~2.0.0",
"mkdirp": ">=0.5 0",
"rimraf": "2"
},
"devDependencies": {
Expand Down

0 comments on commit 8ceb5e8

Please sign in to comment.