New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

makedir

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

makedir

recursively make directories that you need in node.js

  • 0.0.6
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
20
increased by100%
Maintainers
1
Weekly downloads
 
Created
Source

makedir

Recursively and asyncronously make directories in node.js.

I needed this to make RESTful file system caches of rather expensive-to-create database queries on a web server. Other solutions couldn't handle multiple simultaneous creates that you get from asyncronous operation.

To run the test, such as it is

 npm install -d

Then

 make test

Because I haven't figure out how to put this in the Makefile yet, you'll have to remove the created directories manually. Sorry about that

rm makedirtests/ -rf
rm /tmp/makedirtests/ -rf

To use, just pass the directory that you want to make. It will climb up the directory tree until it finds something that exist, and then will recursively create all of the directories that are needed. Pass it a callback to do something with that directory once it is created. For example

var makedir = require('makedir');
var p = '/home/james/some/crazy/long/path'
function doSomethingToPath(path){
      return function(err){
          if(err) throw new Error (err);
              console.log('made '+path);
      };
};
makedir.makedir(p,doSomethingToPath(p));

FAQs

Package last updated on 13 Aug 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

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