go-plugin-fs
Go plugin to work with file system.
Table of Contents
Usage
$ npm install --save-dev go go-plugin-fs
go go
API
Methods
copy
go.copy( source, target [ , options, callback ]): Promise<void>
go.copySync( source, target [ , options ]): void
Copies file or directory to the target destination (it creates missing directories automatically). Read more about fs-extra copy and copySync.
move
go.move( source, target [ , options, callback ]): Promive<void>
go.moveSync( source, target [ , options ]): void
Moves file or directory to the target destination (it creates missing directories automatically). Read more about fs-extra move and moveSync.
remove
go.remove( path [ , callback ]): Promise<void>
go.removeSync( path ): void
Removes file or directory. Read more about fs-extra remove and removeSync.
writeFile
go.writeFile( path, data [ , options, callback ]): Promise<void>
go.writeFileSync( path, data [ , options ]): void
Creates or rewrites the file with given content. Read more about fs-extra outputFile and outputFileSync.
readFile
go.readFile( path [ , options, callback ]): Promise<void>
go.readFileSync( path [ , options ]): void
Reads the content from the given file. Read more about NodeJS readFile and readFileSync.
createDir
go.createDir( path, data [ , options, callback ]): Promise<void>
go.createDirSync( path, data [ , options ]): void
Creates the directory if it doesn't exist (it also creates missing directories in the path automatically). Read more about fs-extra ensureDir and ensureDirSync.
Examples
Basic usage
const newComponentName = 'new-component'go
Read and write file
const contributorsPath = './CONTRIBUTORS.md'const newContributor = 'Chuck Norris' go
License
MIT © Stanislav Termosa