mapbox / mapbox/node-zipfile

Update mkdirp dev dep

Open
#85 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
C++
Stars
101
Forks
42
PR merge metrics
No merged PRs in 30d

Description

This simple patch seems enough:

--- a/test/write.test.js
+++ b/test/write.test.js
@@ -25,8 +25,7 @@
             var dest2 = path.join(__dirname,'tmp', 'aync-copy',name);
             mkdirp.sync(path.dirname(dest));
             mkdirp.sync(path.dirname(dest2));
-            mkdirp(path.dirname(dest), function(err) {
-                if (err) throw err;
+            mkdirp(path.dirname(dest)).then(() => {
                 if (path.extname(name)) {
                     zf.readFile(name, function(err, buffer) {
                         if (err) throw err;
@@ -48,6 +47,8 @@
                         });
                     });
                 }
+            }).catch( err => {
+                throw err;
             });
         });
     });

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Read test/write.test.js and compare its mkdirp calls with the proposed promise-based patch. Verify the write tests pass with the updated mkdirp development dependency and that errors still surface as expected.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
testing, tooling
Issue type
Refactor
Difficulty
1/5
Estimated time
1-3 hours
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.