npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

file-copier2json

v1.0.0

Published

[![npm version](https://img.shields.io/npm/v/file-copier-cli.svg)](https://www.npmjs.com/package/file-copier-cli) [![Build Status](https://img.shields.io/travis/username/file-copier-cli.svg)](https://travis-ci.org/username/file-copier-cli) [![License](htt

Downloads

4

Readme

File Copier CLI

npm version Build Status License

File Copier CLI is a command-line tool that allows you to easily copy files from a source directory to a JSON file, with the option to ignore specific files and directories. It provides an interactive prompt for configuring the file copying process and supports reading ignore patterns from a .gitignore file or custom configuration.

Installation

You can install File Copier CLI globally using npm:

npm install -g file-copier

Alternatively, you can install it as a local dependency in your project:

npm install --save-dev file-copier

Usage

To use File Copier CLI, navigate to the directory where you want to copy files from and run the following command:

file-copier

The CLI will prompt you with a series of questions to configure the file copying process:

  1. Use .gitignore: You will be asked if you want to use a .gitignore file for specifying ignored files and directories. If you choose yes and a .gitignore file exists in the current directory, its contents will be used as ignore patterns.

  2. Ignore Paths: If you choose not to use a .gitignore file, you will be prompted to enter comma-separated paths to ignore. These paths can be file names, directory names, or glob patterns.

  3. Output File Name: You will be asked to enter the desired name for the output JSON file. The default value is output.json.

  4. Output Directory: You will be asked to enter the directory where you want to save the output JSON file. The default value is the current working directory.

After answering the prompts, File Copier CLI will process the files in the current directory and its subdirectories, excluding any ignored files and directories based on the specified ignore patterns. The resulting file data will be saved to the output JSON file in the specified output directory.

Configuration

File Copier CLI supports reading configuration options from a file-copier.config file located in the current directory. If a file-copier.config file exists, its options will be used as the default values for the CLI prompts.

The file-copier.config file should be a JSON file with the following structure:

{
  "ignore": [
    "node_modules",
    "dist",
    "*.log"
  ],
  "outputFileName": "output.json",
  "outputDirectory": "path/to/output"
}
  • ignore: An array of ignore patterns (file names, directory names, or glob patterns) to exclude from the file copying process.
  • outputFileName: The desired name for the output JSON file.
  • outputDirectory: The directory where the output JSON file should be saved.

If any of these options are not specified in the file-copier.config file, the CLI will prompt the user for the missing values.

CLI Options

File Copier CLI supports the following command-line options:

  • -s, --source <path>: Specify the source directory path. Defaults to the current working directory.
  • -i, --ignore <file>: Specify an ignore file path (e.g., .gitignore) to read ignore patterns from.

Examples

Copy files from the current directory to output.json:

file-copier

Copy files from a specific directory to result.json:

file-copier -s path/to/source -o result.json

Use a custom ignore file:

file-copier -i .myignore

Contributing

Contributions are welcome! If you find any issues or have suggestions for improvement, please open an issue or submit a pull request on the GitHub repository.

License

This project is licensed under the MIT License.