Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/metalsmith/remove
A Metalsmith plugin to remove files from the build
https://github.com/metalsmith/remove
metalsmith metalsmith-plugin remove
Last synced: 2 days ago
JSON representation
A Metalsmith plugin to remove files from the build
- Host: GitHub
- URL: https://github.com/metalsmith/remove
- Owner: metalsmith
- License: mit
- Created: 2014-03-06T21:30:01.000Z (almost 11 years ago)
- Default Branch: main
- Last Pushed: 2024-11-04T20:19:22.000Z (2 months ago)
- Last Synced: 2025-01-12T14:40:47.138Z (6 days ago)
- Topics: metalsmith, metalsmith-plugin, remove
- Language: JavaScript
- Homepage: https://github.com/metalsmith/remove#readme
- Size: 2.43 MB
- Stars: 20
- Watchers: 38
- Forks: 12
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# @metalsmith/remove
A Metalsmith plugin to remove files from the build
[![metalsmith: core plugin][metalsmith-badge]][metalsmith-url]
[![npm: version][npm-badge]][npm-url]
[![ci: build][ci-badge]][ci-url]
[![code coverage][codecov-badge]][codecov-url]
[![license: MIT][license-badge]][license-url]Use `@metalsmith/remove` to discard files from the build output after their metadata and contents have been read and used by plugins. While `Metalsmith#ignore` ignores the matched files completely, `@metalsmith/remove` _only_ removes them at the point the plugin is `use`'d.
## Installation
NPM:
```bash
npm install @metalsmith/remove
```Yarn:
```bash
yarn add @metalsmith/remove
```## Usage
Pass the plugin with options to `Metalsmith#use`:
```js
import remove from '@metalsmith/remove'metalsmith.use(remove('drafts/*')) // single pattern
metalsmith.use(remove(['drafts/*', 'unfinished/*'])) // multiple patterns
```### Debug
To enable debug logs, set the `DEBUG` environment variable to `@metalsmith/remove*`:
```js
metalsmith.env('DEBUG', '@metalsmith/remove*')
```Alternatively you can set `DEBUG` to `@metalsmith/*` to debug all Metalsmith core plugins.
### CLI Usage
To use this plugin with the Metalsmith CLI, add `@metalsmith/remove` to the `plugins` key in your `metalsmith.json` file:
```json
{
"plugins": [{ "@metalsmith/remove": "drafts/*" }]
}
```But you can also pass an array of patterns to ignore:
```json
{
"plugins": [{ "@metalsmith/remove": ["drafts/*", "unfinished/*"] }]
}
```## License
[MIT](LICENSE)
[npm-badge]: https://img.shields.io/npm/v/@metalsmith/remove.svg
[npm-url]: https://www.npmjs.com/package/@metalsmith/remove
[ci-badge]: https://github.com/metalsmith/remove/actions/workflows/test.yml/badge.svg
[ci-url]: https://github.com/metalsmith/remove/actions/workflows/test.yml
[metalsmith-badge]: https://img.shields.io/badge/metalsmith-plugin-green.svg?longCache=true
[metalsmith-url]: https://metalsmith.io
[codecov-badge]: https://img.shields.io/coveralls/github/metalsmith/remove
[codecov-url]: https://coveralls.io/github/metalsmith/remove
[license-badge]: https://img.shields.io/github/license/metalsmith/remove
[license-url]: LICENSE