1.0.3 • Published 6 months ago

file-flattener v1.0.3

Weekly downloads
-
License
NONE
Repository
-
Last release
6 months ago

File Flattener

A Node.js tool to consolidate and organize text files by extension into a single output file, with customizable inclusion and exclusion rules.

Installation

Install the package using npm:

npm install -g file-flattener

Usage

After installation, the tool can be used from the command line as follows:

flatten --extensions <file-extensions> --blacklist <blacklisted-directories>
  • --extensions, -e: A comma-separated list of file extensions to include (e.g., .js,.txt).
  • --blacklist, -b: A comma-separated list of directories to exclude (e.g., node_modules,dist). -- negExtensions, -n: A comma-separated list of file extensions to exclude (e.g., .log,.bak).

The script will output the contents of the included files to the console, each prepended with its relative file path.

Example

flatten -e ".js,.html" -b "node_modules,dist" -i ".log,.bak"

This will output to the console the contents of all .js and .html files, excluding any within node_modules or dist directories and any files with .log or .bak extensions.

Advanced Features

  • The tool performs a simple binary check to determine if a file is a text file and should be included.
  • The output includes the relative path of each file for better organization.
1.0.3

6 months ago

1.0.2

6 months ago

1.0.1

6 months ago

1.0.0

6 months ago