Documentation ¶
Index ¶
- Variables
- func Checksum(content string) (string, error)
- func Chmod(file string, perm fs.FileMode) error
- func Chown(file string, user int, group int) error
- func Copy(origin string, destination string) error
- func Delete(file string) error
- func Dir(path string) string
- func EnsureDirectory(file string) error
- func Exec(cmd string, args ...string) (string, error)
- func Exist(path string) bool
- func Extension(file string) string
- func File(path string) string
- func Info(file string) (string, string, fs.FileMode)
- func List(root string) ([]string, error)
- func Name(path string) string
- func NoColor() bool
- func NodeRequire(command string, pkg string) error
- func Permissions(path string) (fs.FileMode, error)
- func Printf(color string, format string, args ...interface{})
- func RandomString(n int) string
- func Read(file string) (string, error)
- func Relative(path string, root string) string
- func Rename(origin string, destination string) error
- func Replace(file string, search string, replace string) error
- func Resolve(file string, extensions []string, path string) string
- func TemporaryFile(file string) string
- func Watch(path string, interval time.Duration, onChange WatchCallback, ...)
- func Write(file string, content string, perm fs.FileMode) error
- type WatchCallback
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Reset = "\033[0m" Red = "\033[31m" Green = "\033[32m" Yellow = "\033[33m" Blue = "\033[34m" Purple = "\033[35m" Cyan = "\033[36m" Gray = "\033[37m" White = "\033[97m" Notice = Cyan Warn = Yellow Fatal = Red Success = Green )
Colors
Functions ¶
func EnsureDirectory ¶
EnsureDirectory makes sure directory exists from file path
func NoColor ¶ added in v0.0.8
func NoColor() bool
NoColor check if should avoid color output on console
func NodeRequire ¶ added in v0.0.5
NodeRequire check if node package command exists, otherwise, try to install the package
func Permissions ¶
Permissions retrieve permissions for file or directory
func RandomString ¶ added in v0.0.11
RandomString generates a random string from give size
func Resolve ¶ added in v0.0.15
Resolve will check paths with possible extensions until file is detected
func TemporaryFile ¶ added in v0.0.11
TemporaryFile return a temporary file path
func Watch ¶
func Watch(path string, interval time.Duration, onChange WatchCallback, onDelete WatchCallback)
Watch check for changes on path files and trigger events on change or on delete file
Types ¶
Click to show internal directories.
Click to hide internal directories.