Socket
Socket
Sign inDemoInstall

mkpath

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

mkpath

Make all directories in a path, like mkdir -p


Version published
Maintainers
1
Created

What is mkpath?

The mkpath npm package is used to create directories recursively, meaning it can create a directory and any necessary subdirectories in a single call. This is particularly useful for ensuring that a directory structure exists before writing files to it.

What are mkpath's main functionalities?

Create Nested Directories

This feature allows you to create a nested directory structure in one go. The code sample demonstrates how to create the directories 'path/to/nested/directories' and handle any potential errors.

const mkpath = require('mkpath');
mkpath('path/to/nested/directories', function (err) {
  if (err) throw err;
  console.log('Directories created');
});

Custom Permissions

This feature allows you to set custom permissions for the directories being created. The code sample shows how to create directories with the permission set to 0755.

const mkpath = require('mkpath');
mkpath('path/to/nested/directories', 0755, function (err) {
  if (err) throw err;
  console.log('Directories created with custom permissions');
});

Other packages similar to mkpath

Keywords

FAQs

Package last updated on 30 Oct 2015

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