CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/npm-filemanager-webpack-plugin

Webpack plugin to copy, archive (.zip), move, delete files and directories before and after builds

Pending
Quality

Pending

Does it follow best practices?

Impact

Pending

No eval scenarios have been run

SecuritybySnyk

Pending

The risk profile of this skill

Overview
Eval results
Files

mkdir.mddocs/

Directory Creation

Create directory paths with full recursive support, automatically creating parent directories as needed.

Capabilities

Mkdir Action Function

Main mkdir action function that processes directory creation tasks.

/**
 * Execute mkdir tasks with the provided options
 * @param tasks Array of mkdir tasks to execute
 * @param taskOptions Task execution options including logger and error handling
 */
function mkdirAction(tasks: MkdirTask[], taskOptions: TaskOptions): Promise<void>;

export default mkdirAction;

Mkdir Action Configuration

Simple string-based configuration for directory creation operations.

/**
 * Configuration for directory creation operations
 * Simple string path to directory to create
 */
type MkdirAction = string;

Internal Task Structure

Internal task structure used by the plugin during mkdir execution.

/**
 * Internal task structure for mkdir operations
 */
interface MkdirTask {
  source: string;
  absoluteSource: string;
}

Usage Examples:

// Single directory creation
{
  mkdir: ['./dist']
}

// Multiple directory creation
{
  mkdir: [
    './dist',
    './dist/assets',
    './dist/css',
    './dist/js'
  ]
}

// Nested directory creation (recursive)
{
  mkdir: [
    './dist/assets/images/thumbnails',
    './dist/data/cache',
    './temp/logs/debug'
  ]
}

// Absolute path directory creation
{
  mkdir: [
    '/tmp/webpack-build',
    '/var/log/myapp'
  ]
}

Directory Creation Behavior

Recursive Creation

All directory creation operations are recursive by default:

  • Parent directories created automatically if they don't exist
  • No error if directory already exists
  • Full path created in single operation

Path Resolution

  • Relative paths resolved against plugin context or Webpack context
  • Absolute paths used as-is
  • Cross-platform path handling with normalized separators

Permissions

  • Directories created with default system permissions
  • Inherits permissions from parent directory where applicable
  • No custom permission options available

Error Handling

Mkdir operations handle various error conditions:

  • Permission denied: Error logged and handled based on throwOnError setting
  • Invalid path: Invalid characters or reserved names cause errors
  • Existing files: Error if a file exists at the target directory path
  • File system full: Space errors handled gracefully

Use Cases

Build Preparation

{
  events: {
    onStart: {
      mkdir: [
        './dist',
        './dist/assets',
        './dist/css',
        './dist/js'
      ]
    }
  }
}

Cache Directory Setup

{
  events: {
    onStart: {
      mkdir: [
        './cache',
        './cache/webpack',
        './temp/build'
      ]
    }
  }
}

Log Directory Creation

{
  events: {
    onStart: {
      mkdir: [
        './logs',
        './logs/build',
        './logs/errors'
      ]
    }
  }
}

docs

archive.md

configuration.md

copy.md

delete.md

index.md

mkdir.md

move.md

tile.json