prompt-path

Get the file system path in CLI app

Usage no npm install needed!

<script type="module">
  import promptPath from 'https://cdn.skypack.dev/prompt-path';
</script>

README

prompt-path

build: passing test: 1.0.0

When you need to prompt a path in your CLI app.

Usage

const { promptPath } = require("prompt-path");

promptPath().then((path) => {
    console.log(path);
});

Params (optional)

const path = await promptPath({
    basePath: "~",
    prefix: "file: ",
    target: PromptPathTarget.File,
});
  • basePath Initial path (current directory by default).
  • prefix The prompt string to use ('> ' by default).
  • target File or directory (both by default).