Huge News!Announcing our $40M Series B led by Abstract Ventures.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 - npm Package Compare versions

Comparing version 0.5.0-next.1 to 0.5.0

7

CHANGELOG.md

@@ -0,1 +1,8 @@

# [0.5.0](https://github.com/alex-ketch/metalsmith-renamer/compare/v0.4.1...v0.5.0) (2020-05-29)
### Features
* Add Microbundle for releasing as ES module ([be995e9](https://github.com/alex-ketch/metalsmith-renamer/commit/be995e971d4bf62f5a3427eb76037b30e8629444))
# [0.5.0-next.1](https://github.com/alex-ketch/metalsmith-renamer/compare/v0.4.1...v0.5.0-next.1) (2020-05-27)

@@ -2,0 +9,0 @@

2

package.json
{
"name": "metalsmith-renamer",
"version": "0.5.0-next.1",
"version": "0.5.0",
"description": "Plugin to take a pattern and rename each matched file",

@@ -5,0 +5,0 @@ "source": "src/index.js",

# metalsmith-renamer
![Release](https://github.com/alex-ketch/metalsmith-renamer/workflows/Release/badge.svg)
This is a plugin for [Metalsmith](http://www.metalsmith.io) that renames files matching a given `pattern`.
Presently it only accepts files, not folders, but folder renaming is planned for the near future.
## ❄️ Project Status
This project is on somewhat of an auto-pilot which means:
- As I don't use Metalsmith any more, I'm not familiar enough with it to provide support with issues.
- I will accept fixes and feature PRs only if:
- they come with tests and relevant documentation.
- Releases will happen automatically once merged, so you must use [Semantic Release style commit
messages](https://semantic-release.gitbook.io/semantic-release/#commit-message-format).
Thanks for your understanding!
---
## Usage

@@ -16,3 +32,3 @@

.use(renamer({
filesToRename: {
filesToRename: { // this name is only used to help organize different settings
pattern: 'folder/**/*.md',

@@ -26,3 +42,3 @@ rename: function(name) {

rename: 'index.html'
}, //and as many more patterns as you want
}, // and as many more patterns as you want
}

@@ -35,16 +51,10 @@ })

metalsmith-renamer has two options, both of which must be defined:
- `pattern` option which uses [minimatch](https://github.com/isaacs/minimatch) to filter files.
- `rename` which takes a string argument for what you'd like the files to be named, or a function that takes a matched file name and returns the new one to be used.
`metalsmith-renamer` has two options, both of which must be defined:
- `pattern`: option which uses [minimatch](https://github.com/isaacs/minimatch) to find files to rename.
- `rename`: which takes a `string` argument for what you'd like the files to be named, or a `function` that takes a matched
file name and returns the new one to be used.
## Use cases
- I use it to simulate [metalsmith-permalinks](https://github.com/segmentio/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
- [x] v0.1 Core renaming functionality
- [x] v0.2 Allow specifying multiple inputs, avoiding the need to call the plugin multiple times.
- [ ] v0.4 Allow renaming of directories.
- [ ] v0.5 Clean up declaration method to take named objects, or a single unnamed one.
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