New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

metalsmith-renamer

Package Overview
Dependencies
Maintainers
1
Versions
228
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

metalsmith-renamer

Plugin to take a pattern and rename each matched file

  • 0.1.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
389
increased by155.92%
Maintainers
1
Weekly downloads
 
Created
Source

metalsmith-renamer

This is a plugin for Metalsmith that renames files matching a given pattern

Usage

If using the CLI for Metalsmith, metalsmith-renamer can be used like any other plugin by including it in metalsmith.json. For example:

{
  "plugins": {
    "metalsmith-renamer": {
      "pattern": "folder/*.md",
      "rename": "folder/newName.md"
    }
  }
}

For Metalscript's JavaScript API, metalsmith-renamer can be used like any other plugin, by attaching it to the function invocation chain on the Metalscript object. For example:

var renamer = require('metalsmith-renamer');
require('metalsmith')(__dirname)
  .use(renamer({
    pattern: 'folder/*.md',
    rename: 'folder/newName.md'
    }
  })
  .build();

Options

metalsmith-renamer has two options, both of which must be defined:

  • pattern option which uses minimatch to filter files.
  • rename which takes a string argument for what you'd like the files to be named.

Use cases

  • I use it to simulate metalsmith-permalinks partially by renaming certain files index.html, allowing me to link straight to directories and not have to use the filename. metalsmith-permalink insists on enclosing files within a structured folder system, whereas I have folder already organized manually.
  • Use it to rename folder names for preprocessor stylesheets, allowing you to keep a Stylus/SCSS/Less folder in your src folder, and then rename it to css in production build.

Roadmap

  • v0.1 Core renaming functionality
  • v0.2: Allow specifying multiple inputs, avoiding the need to call the plugin multiple times.

Keywords

FAQs

Package last updated on 27 Oct 2015

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