Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/rajput-vinay/file-operations-cli

A Command-Line Interface (CLI) tool for performing various file operations using Node.js. This tool allows you to create, read, write, edit, count words and lines, and delete files from the terminal.
https://github.com/rajput-vinay/file-operations-cli

Last synced: 5 days ago
JSON representation

A Command-Line Interface (CLI) tool for performing various file operations using Node.js. This tool allows you to create, read, write, edit, count words and lines, and delete files from the terminal.

Awesome Lists containing this project

README

        

# file-operations-cli

A Command-Line Interface (CLI) tool for performing various file operations using Node.js. This tool allows you to create, read, write, edit, count words and lines, and delete files from the terminal.

## Features

- **Count Words**: Count the number of words in a file.
- **Count Lines**: Count the number of lines in a file.
- **Create File**: Create a new file if it does not already exist.
- **Read File**: Read and display the content of a file.
- **Write File**: Write content to a file.
- **Edit File**: Replace specified text in a file with new content.
- **Delete File**: Delete a specified file.

## Installation

1. **Clone the repository:**

```bash
git clone https://github.com/Rajput-vinay/file-operations-cli.git

2. **Navigate to the project directory:**

```bash
cd file-operations-cli

3. **Install the dependencies:**
```bash
npm install

4. **Run in terminal:**
```bash
npm link

## Usage

You can use the CLI tool by running the following commands:

### Count Words

cdl-vinay countWord

### Create File
```bash
cdl-vinay createFile

### Count Lines
```bash
cdl-vinay countLine

### Read File
```bash
cdl-vinay readFile

### Write File
```bash
cdl-vinay writeFile

### Edit File
```bash
cdl-vinay editFile

###Delete File
```bash
cdl-vinay deleteFile

#Example
To count the number of words in a file named example.txt:

```bash
cdl-vinay countWord example.txt

## Contributing

1. **Fork the repository** to your own GitHub account.
2. **Create a new branch** for your feature or bug fix.
3. **Make your changes** and test them.
4. **Submit a pull request** with a description of the changes.