unified vfile

  • プロファイル: new VFile(arg? : (Options | string | buffer | VFile) ) : VFile

引数:

  1. arg: Options → 正規の引数
  2. arg: (string | Buffer ) → arg := {value: arg} と再設定
  3. arg:VFile → シャローコピーを返す。
  4. arg: undefined → おそらくデフォルトのVFileを返す。

オペレーションまたはプロパティ:

  1. value : (Buffer | string | null) — Raw value.
  2. cwd: string — Base of path. Defaults to process.cwd().
  3. path: string? — Path of vfile. Cannot be nullified. You can set a file URL (a URL object with a file: protocol) which will be turned into a path with url.fileURLToPath.
  4. basename: string? — Current name (including extension) of vfile. Cannot contain path separators. Cannot be nullified either (use file.path = file.dirname instead).
  5. stem: string? — Name (without extension) of vfile. Cannot be nullified, and cannot contain path separators.
  6. extname: string? — Extension (with dot) of vfile. Cannot be set if there’s no path yet and cannot contain path separators.
  7. dirname: string? — Path to parent directory of vfile. Cannot be set if there’s no path yet.
  8. history: Array — List of file-paths the file moved between.
  9. messages: Array — List of messages associated with the file.
  10. data: Object? — Place to store custom information. It’s OK to store custom data directly on the vfile, moving it to data gives a little more privacy.