CLI

CLI

Source:

Below are the APIs of CLI (Command Line Interface). Some inappropriate titles are used because they are generated by JsDoc.

Methods

(static) conv-text()

Source:
Example
Usage: npx fs-hospitality conv-text [options] <filePath> [destPath]

Converting a text encoding.

Options:
  -V, --version          output the version number
  -T, --trim <type>      "all" | "start" | "end"
  -E, --eol <type>       "lf" | "cr" | "crlf" or "unix" | "mac" | "dos"
  -B, --bom              Add BOM. Only UTFx encoding
  -e, --encoding <name>  "UTF-16BE", "Shift_JIS", ... "Default: "utf8" (default: "utf8")
  -h, --help             display help for command

// Ex1.
> npx fs-hospitality conv-text "D:\Test\src.wsf" --trim "all" --eol "dos" --bom

(static) detect-text-spec()

Source:
Example
npx fs-hospitality detect-text-spec [options] <filePath>

Detecting a text specification.

Options:
  -V, --version      output the version number
  -T, --type <name>  "all" | "encoding" | "eol"
  -h, --help         display help for command

// Ex1.
$ npx fs-hospitality detect-text-spec "D:\Test\src.wsf" --type "encoding"
SJIS

// Ex2.
$ npx fs-hospitality detect-text-spec "D:\Test\src.wsf" --type "eol"
crlf

(static) ls()

Source:
Example
Usage: npx fs-hospitality ls [options] <dirPath>

Detecting a text specification.

Options:
  -V, --version                output the version number
  -D, --is-only-dir            Exacting directories only
  -F, --is-only-file           Exacting files only
  -S, --excludes-symlink       Excluding symbolic-links
  -M, --matched-reg-exp <exp>  Ex. "\d+\.txt$"
  -I, --ignored-reg-exp <exp>  Ex. "[_\-.]cache\d+"
  -W, --with-file-types        Returns file info objects (like fs.Dirent)
  -h, --help                   display help for command

// Ex1. No options
$ npx fs-hospitality ls "D:\Test"
[
  'DirFoo-Symlink',
  'fileRoot2-Symlink.log',
  'fileRoot2.log',
  'FILE_ROOT1.TXT',
  'DirFoo',
  'DirBar',
  'DirBar\\fileBar1.txt',
  'DirBar\\DirQuux',
  'DirBar\\DirQuux\\fileQuux1-Symlink.txt',
  'DirBar\\DirQuux\\fileQuux1.txt'
]