stc-file
Virtual File for stc
How to use
; let file = cwd: '' //current work path base: '' //base name path: 'path/to/file' //file path stat: null //file stat;
API
path
get or set file path.
filepath = 'xxx';filepath;
extname
get or set file extname.
fileextname; // htmlfileextname = 'txt'; //
stat
get or set file stat.
let stat = filestat;filestat = stat;
isFile()
let isFile = file;
isDirectory()
let isDirectory = file;
pipe(stream, opt)
pipe file stream to another stream.
file;
isPath(filepath)
check file path
getContent(encoding)
get file content,
encoding
default isnull
setContent(content)
hasAst()
check file aleady have ast
getAst()
setAst(ast)
prop(name, value)
get or set other property for file