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-renamer-cli

v1.0.5

Published

A command-line interface tool to automatically rename and organize screenshot files based on timestamps and JIRA IDs.

Downloads

494

Readme

file-renamer-cli

A command-line interface tool to automatically rename and organize screenshot files based on timestamps and JIRA IDs.

Features

  • Automatically renames screenshot files using JIRA IDs and timestamps
  • Groups screenshots into test cases based on configurable time gaps
  • Supports dry run mode for previewing changes
  • Provides undo functionality for reverting the last renaming operation
  • Easy to use with intuitive command-line options

Installation

You can install Screenshot Renamer CLI globally using npm:

npm install -g file-renamer-cli

Usage

Basic Usage

To rename screenshots in a specific directory:

file-renamer-cli -d /path/to/your/screenshots

You will be prompted to enter a JIRA ID (e.g., SSM-123). The tool will then process all PNG files in the directory that match the naming pattern "Screenshot YYYY-MM-DD at HH.MM.SS AM/PM.png".

Command-line Options

  • -d, --directory <path>: Specify the directory containing screenshots.
  • -t, --time-gap <minutes>: Set the time gap (in minutes) to separate test cases. Default is 5 minutes.
  • --dry-run: Perform a dry run without actually renaming files.
  • --undo: Undo the last renaming operation.

Examples

  1. Rename screenshots with a custom time gap:
file-renamer-cli -d /path/to/screenshots -t 10

This sets the time gap to 10 minutes. Screenshots taken more than 10 minutes apart will be considered part of different test cases.

  1. Perform a dry run:
file-renamer-cli -d /path/to/screenshots --dry-run

This will show you how files would be renamed without making any changes.

  1. Undo the last renaming operation:
file-renamer-cli --undo

File Naming Convention

The tool expects screenshot files to follow this naming convention:

Screenshot YYYY-MM-DD at HH.MM.SS AM/PM.png

For example: "Screenshot 2024-09-22 at 2.31.16 AM.png"

Only files matching this pattern will be processed.

Output

  1. Renamed Files: The tool will rename your files to the format [JIRA-ID]-tc-[TestCaseNumber]-[ScreenshotNumber].png.
  2. Console Output: The tool will print information about each renaming operation.
  3. Log File: A rename_log.json file is created in the working directory, recording all renaming operations.

Best Practices

  1. Always run with --dry-run first to verify the expected changes.
  2. Use descriptive JIRA IDs to easily identify the associated task or bug.
  3. Regularly back up your screenshots before running the tool.
  4. Use the -t option to adjust the time gap based on your testing workflow.

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/AmazingFeature)
  3. Commit your changes (git commit -m 'Add some AmazingFeature')
  4. Push to the branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

This project is licensed under the MIT License - see the LICENSE file for details.

Support

If you encounter any problems or have any questions, please open an issue in the GitHub repository.

Acknowledgments

  • Thanks to all contributors who have helped shape this tool.
  • Inspired by the need for efficient screenshot management in software testing workflows.