# broccoli-file-mover

> Broccoli plugin to move a single file.

Latest version **0.4.2** (published 2014-10-13) · MIT license · 0 weekly downloads

## Install

```sh
npm install broccoli-file-mover
pnpm add broccoli-file-mover
yarn add broccoli-file-mover
bun add broccoli-file-mover
```

## 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.4.2 |
| Published | 2014-10-13 |
| First published | 2014-04-21 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 5 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 3 |
| Author | Robert Jackson |
| Maintainers | rwjblue |
| Keywords | broccoli-plugin, javascript |

## Links

- npm: https://www.npmjs.com/package/broccoli-file-mover
- Repository: https://github.com/rjackson/broccoli-file-mover
- Issues: https://github.com/rjackson/broccoli-file-mover/issues
- npm.io page: https://npm.io/package/broccoli-file-mover

## Dependencies (5)

- [chalk](https://npm.io/package/chalk.md) ^0.5.1
- [mkdirp](https://npm.io/package/mkdirp.md) ~0.5.0
- [rimraf](https://npm.io/package/rimraf.md) ~2.2.6
- [broccoli-writer](https://npm.io/package/broccoli-writer.md) ~0.1.1
- [symlink-or-copy](https://npm.io/package/symlink-or-copy.md) ^1.0.0

## Recent versions

- 0.4.2 (latest) — 2014-10-13
- 0.4.1 — 2014-09-29
- 0.3.6 — 2014-08-28
- 0.4.0 — 2014-07-03
- 0.3.5 — 2014-06-04
- 0.3.4 — 2014-05-30
- 0.3.3 — 2014-05-30
- 0.3.2 — 2014-05-21
- 0.3.1 — 2014-04-29
- 0.3.0 — 2014-04-26
- 0.2.0 — 2014-04-21
- 0.1.0 — 2014-04-21

## README

# Broccoli's File Mover

**This project has been replaced by [broccoli-funnel](https://github.com/rwjblue/broccoli-funnel). Please see migration process below.**

[![Build Status](https://travis-ci.org/rjackson/broccoli-file-mover.svg?branch=master)](https://travis-ci.org/rjackson/broccoli-file-mover)

## Migrating to broccoli-funnel

Instead of the following:

```javascript
var tree = moveFile('packages/ember-metal/lib', {
  srcFile: 'main.js',
  destFile: '/ember-metal.js'
});
```

You would use:

```javascript
var tree = new Funnel('packages/ember-metal/lib', {
  destDir: 'ember-metal',

  getDestinationPath: function(relativePath) {
    if (relativePath === 'main.js') {
      return 'ember-metal.js';
    }

    return relativePath;
  }
});
```

## Installation

```bash
npm install --save-dev broccoli-file-mover
```

## Usage

Moving a single file from `app/main` to `app`:

```javascript
var moveFile = require('broccoli-file-mover');

var tree = moveFile('app', {
  srcFile: 'app/main.js',
  destFile: '/app.js'
});
```

Moving `app/main` to `app` and `test/main` to `test`:

```javacript
var moveFile = require('broccoli-file-mover');

var tree = moveFile('app', {
  files: {
    'app/main.js': 'app.js',
    'test/main.js': 'test.js'
  }
});
```

## Documentation

### `moveFile(inputTree, options)`

---

`options.srcFile` *{String}*

The path of the file to move (starting location).

---

`options.destFile` *{String}*

The path to move the file to (final location).

---

`options.files` *{Array|Object}*

This allows specifying more than one move/copy operation at a time (and reduced the total number of trees/steps
needed if you need to move many files).

 - If `files` is an object the key is used as the source path, and the value is the destination path.
 - If `files` is an array each item must be an object with a `srcFile` and `destFile` property. If `copy` is present it will
   be used also.

## ZOMG!!! TESTS?!?!!?

I know, right?

Running the tests:

```javascript
npm install
npm test
```

## License

This project is distributed under the MIT license.

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