CLI tool to do basic file operations (copy, read, write, move...) in a cross-platform way
npm install file-cli
CLI tool to do basic file operations in a cross-platform way. Uses fs-extra under the hood.
npm i -g file-cli
`Or install into your project's dev-dependencies to use in your scripts:
`
npm i -D file-cli
`Commands
The CLI can be used as fcli, which is a little shorter than file-cli.Run
fcli --help to view a list of commands in your terminal.#### Read
`
fcli read
`Reads a file and prints it to stdout
#### Write
`
fcli write
`Writes data to a file
#### Ensure
`
fcli ensure [-f]
`Ensures a file or directory exists.
-
-f, --file: path is a file#### Copy
`
fcli copy [-o]
`Copies a file or the contents of a directory (unix equivalent:
cp -r)-
-o, --overwrite: overwrite target file if it already exists#### Move
`
fcli move [-o]
`Moves or renames a file (unix equivalent:
mv)-
-o, --overwrite: overwrite target file if it already exists#### Remove
`
fcli remove
`Removes a file or directory (unix equivalent:
rm -rf`)