Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

file-flattener

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

file-flattener

File flattener

  • 1.0.3
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1
Maintainers
1
Weekly downloads
 
Created
Source

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.

Keywords

FAQs

Package last updated on 17 Nov 2023

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc