You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

file-cli

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-cli

CLI tool to do basic file operations (copy, read, write, move...) in a cross-platform way

1.2.0
latest
Source
npmnpm
Version published
Weekly downloads
12
-14.29%
Maintainers
1
Weekly downloads
 
Created
Source

File CLI

npm David MIT license

CLI tool to do basic file operations in a cross-platform way. Uses fs-extra under the hood.

Install

Install globally:

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 <path>

Reads a file and prints it to stdout

Write

fcli write <path> <data>

Writes data to a file

Ensure

fcli ensure <path> [-f]

Ensures a file or directory exists.

  • -f, --file: path is a file

Copy

fcli copy <from> <to> [-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 <from> <to> [-o]

Moves or renames a file (unix equivalent: mv)

  • -o, --overwrite: overwrite target file if it already exists

Remove

fcli remove <path>

Removes a file or directory (unix equivalent: rm -rf)

Keywords

file

FAQs

Package last updated on 17 Feb 2020

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts