← All procedures

fs.mkdir

Create directory

CLI
Package
@procedures/fs · README
Path
["fs","mkdir"]
CLI
mark fs mkdir --path <string>
As data
{"$proc":["fs","mkdir"],"input":{}}

Use it

In TypeScript

import { Client, LocalTransport, PROCEDURE_REGISTRY } from "@procedures/client";
import "@procedures/fs"; // registers its procedures

const client = new Client(new LocalTransport({ registry: PROCEDURE_REGISTRY }));
const result = await client.exec(["fs","mkdir"], { path: "<path>" });
console.log(JSON.stringify(result));

From the command line

$ mark fs mkdir --path <string>

As data, in a program

{ "$proc": ["fs", "mkdir"], "input": { "path": "<path>" } }

Input

FieldTypeRequiredDefaultDescription
pathstringyesPath of directory to create
recursivebooleannotrueCreate parent directories if needed (default: true)

Output

FieldTypeRequiredDefaultDescription
pathstringyesThe path of the folder
createdbooleanyesFalse when the folder existed already
JSON Schemas
{
  "input": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "Path of directory to create"
      },
      "recursive": {
        "default": true,
        "description": "Create parent directories if needed (default: true)",
        "type": "boolean"
      }
    },
    "required": [
      "path"
    ]
  },
  "output": {
    "type": "object",
    "properties": {
      "path": {
        "type": "string",
        "description": "The path of the folder"
      },
      "created": {
        "type": "boolean",
        "description": "False when the folder existed already"
      }
    },
    "required": [
      "path",
      "created"
    ],
    "additionalProperties": {}
  }
}