# metalsmith-cleanscript

> Generates a cleanup script for your metalsmith build.

Latest version **0.0.4** (published 2014-03-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install metalsmith-cleanscript
pnpm add metalsmith-cleanscript
yarn add metalsmith-cleanscript
bun add metalsmith-cleanscript
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.4 |
| Published | 2014-03-30 |
| First published | 2014-03-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Shane Creighton-Young |
| Maintainers | srcreigh |
| Keywords | metalsmith, cleanup, clean, script |

## Links

- npm: https://www.npmjs.com/package/metalsmith-cleanscript
- Repository: https://github.com/srcreigh/metalsmith-cleanscript
- Homepage: https://github.com/srcreigh/metalsmith-clean
- Issues: https://github.com/srcreigh/metalsmith-clean/issues
- npm.io page: https://npm.io/package/metalsmith-cleanscript

## Dependencies (1)

- [path](https://npm.io/package/path.md) ^0.4.9

## Alternatives

- [@openai/codex-sdk](https://npm.io/package/@openai/codex-sdk.md) — 731.4K weekly downloads
- [babel-plugin-transform-react-jsx](https://npm.io/package/babel-plugin-transform-react-jsx.md) — 565.0K weekly downloads
- [babel-helper-remove-or-void](https://npm.io/package/babel-helper-remove-or-void.md) — 508.5K weekly downloads
- [@pnpm/store-controller-types](https://npm.io/package/@pnpm/store-controller-types.md) — 186.9K weekly downloads
- [react-native-signature-canvas](https://npm.io/package/react-native-signature-canvas.md) — 155.6K weekly downloads

## Recent versions

- 0.0.4 (latest) — 2014-03-30
- 0.0.3 — 2014-03-30
- 0.0.2 — 2014-03-30
- 0.0.1 — 2014-03-30

## README

metalsmith-cleanscript
======================

Generates a cleanup script for your metalsmith build.
This is useful when your build directory has more than 
what metalsmith has put in there, so cleaning up is not
as simple as 'rm -rf build'.

Example
-------

```
$ ls -R build
clean.sh posts style not-added-by-metalsmith.txt

posts:
page1

posts/page1:
index.html

style:
style.css

$ cat clean.sh
#!/bin/bash
rm /Users/me/build/posts/page1/index.html
rm /Users/me/build/style/style.css

rmdir /Users/me/build/style
rmdir /Users/me/build/posts/page1
rmdir /Users/me/build/posts
rmdir /Users/me/build
```

Install
-------

```
npm install metalsmith-cleanscript
```

Usage
-----

```
var cleanscript = require('metalsmith-cleanscript');

// Use this plugin after any other plugins that may add or change 
// files.
.use(cleanscript("clean.sh"))

// Equivalent to .use(clean()) since clean.sh is the default
// Also equivalent to .use(cleanscript({ out: 'clean.sh' }))
```

Options
-------

### out

the relative path of your newly minted cleanup script

the path you provide will be relative to your build directory,
i.e. the return value of ```metalsmith.build()```.

**note** this is what will be set if you ```use``` cleanscript 
with a string

**default** ```'clean.sh'```

### root

whether or not to try to delete the root build directory

**default** ```true```
            

Todo
----

1. Support multiple scripting languages
2. Add an "ignore" option

License
-------

MIT

---
_Source: https://npm.io/package/metalsmith-cleanscript · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
