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 🙏

© 2025 – Pkg Stats / Ryan Hefner

duplicat

v0.1.1

Published

Duplicate files with ease

Readme

Commands

  • Duplicate (duplicat.duplicate): Opens a QuickPick menu showing matching templates and custom filename option
  • Quick Duplicate (duplicat.quickDuplicate): Automatically applies the first matching template without showing the menu

Both are available via the command palette or right click context menu

Config

| Name | Description | Default | | ----------------------------- | ---------------------------------------------------------------------------------------------------------------------------- | ----------- | | duplicat.openDuplicatedFile | Immediately open the file after duplication (opens the last duplicated file when duplicating multiple files/folders at once) | true | | duplicat.notifySuccess | Show a notification summarising all successful duplicated files/folders | true | | duplicate.templates | Rules to provide quick options for common workflows | See below |

Templates

Templates in DupliCat allow you to define rules for automatic/suggestion-based file renaming. The default configuration for duplicate.templates is:

[{
  "label": "Create test file",
  "matches": "^(?!.*(test|spec)).*$",
  "replacement": "${basename}.spec.${ext}",
  "icon": "disassembly-editor-label-icon"
}]

Each template has four key components:

  1. label: The text displayed in the QuickPick menu when selecting a template
  2. matches: A regular expression pattern that determines which files/folders the template applies to
  3. replacement: The naming pattern used when duplicating matching files/folders
  4. icon: Visual identifier shown in the QuickPick menu (optional, found here)

When you run the Duplicate (duplicat.duplicate) command, DupliCat tests each selected file/folder name against all defined templates. Any matching templates appear as options in the QuickPick menu.

Variables in Replacement Patterns

You can use these variables in your replacement patterns:

  • ${basename}: The original file/folder name without extension
  • ${ext}: The file extension (ignored for folders)

Examples

The default template matches any file that doesn't contain "test" or "spec" in its name and adds ".spec" before the extension:

example.jsexample.spec.js utils.tsutils.spec.ts

Custom Filenames

You can type directly in the QuickPick menu to:

  • Filter available templates by typing part of their label
  • Create a completely custom filename by selecting the "Custom filename" option

Overwrites

Any potential overwrite will show a prompt to confirm/cancel the overwrite. In the case of duplicating multiple files/folders, only the 1 entry is cancelled and you can continue after answering the prompt.

Caveats

  • Currently doesn't support using {capture} in the replacement field of templates, but it will likely get added soon
  • Using the Duplicate command with multiple files only works using the right click context menu.
  • Currently it's not possible to match against parent dirs, but I am open to exploring the idea.

License

MIT License © 2025 Ross Cooper