create-directory

Learn how to create a directory.

This action creates a directory, including any missing parents.

This is helpful for setting up project structure before writing files, such as creating src/components or src/lib directories during scaffolding.

Example

The following template creates a components directory and prints a confirmation:

template.json5
{  "$schema": "https://schema.croct.com/json/v1/template.json",  "title": "Directory setup",  "description": "Creates a components directory.",  "actions": [    {      "name": "create-directory",      "path": "src/components"    },    {      "name": "print",      "semantics": "info",      "message": "Directory src/components is ready."    }  ]}

To apply this template, run:

npx croct@latest use template.json5

Properties

These are the supported properties:

name
string

The action identifier. Always create-directory for this action.

path
string

The path to the directory to create.