Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

mkdir-promise

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkdir-promise - npm Package Compare versions

Comparing version 0.0.3 to 0.0.4

5

index.js

@@ -35,2 +35,5 @@ "use strict";

var paths = dir.split(path.sep);
if (paths[0] === '') {
paths[0] = path.sep;
}
return paths.reduce(function (promise, fp) {

@@ -46,3 +49,3 @@ return promise.then(function (prev) {

} else {
var err = new Error("Conot create directory " + fp + ": Not a directory.");
var err = new Error("Cannot create directory " + fp + ": Not a directory.");
return Promise.reject(err);

@@ -49,0 +52,0 @@ }

2

package.json
{
"name": "mkdir-promise",
"version": "0.0.3",
"version": "0.0.4",
"description": "fs.mkdir implementation with es6 Promise",

@@ -5,0 +5,0 @@ "main": "index.js",

var assert = require("assert");
var mkdir = require("../index");
var child_process = require("child_process");
var path = require('path');

@@ -20,2 +21,11 @@ describe("mkdir -p foo/bar", function () {

});
it("should handle absolute paths", function (done) {
var absolutePath = path.join(__dirname, "foo", "bar");
mkdir(absolutePath).then(function (rst) {
assert.equal(rst, absolutePath);
done();
}).catch(function (ex) {
done(ex);
});
});
after(function () {

@@ -22,0 +32,0 @@ child_process.exec("rm -r foo");

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc