# broccoli-source

> Broccoli plugin for referring to source directories on the file system

Latest version **3.0.1** (published 2021-03-11) · MIT license · 0 weekly downloads

## Install

```sh
npm install broccoli-source
pnpm add broccoli-source
yarn add broccoli-source
bun add broccoli-source
```

## Health

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

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 3.0.1 |
| Published | 2021-03-11 |
| First published | 2015-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | 8.* \|\| 10.* \|\| >= 12.* |
| Dependencies | 1 |
| Unpacked size | 15.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Jo Liss |
| Maintainers | joliss, thoov, rwjblue, stefanpenner |
| Keywords | broccoli-plugin |

## Links

- npm: https://www.npmjs.com/package/broccoli-source
- Repository: https://github.com/broccolijs/broccoli-source
- Homepage: https://github.com/broccolijs/broccoli-source#readme
- Issues: https://github.com/broccolijs/broccoli-source/issues
- npm.io page: https://npm.io/package/broccoli-source

## Dependencies (1)

- [broccoli-node-api](https://npm.io/package/broccoli-node-api.md) ^1.6.0

## Recent versions

- 3.0.1 (latest) — 2021-03-11
- 3.0.0 — 2019-07-30
- 2.1.2 — 2019-05-24
- 2.1.1 — 2019-05-17
- 2.1.0 — 2019-05-17
- 2.0.0 — 2019-04-09
- 1.1.0 — 2015-08-23
- 1.0.0 — 2015-08-23

## README

# Broccoli Source

[![Build Status](https://travis-ci.org/broccolijs/broccoli-source.svg?branch=master)](https://travis-ci.org/broccolijs/broccoli-source)
[![Build status](https://ci.appveyor.com/api/projects/status/rrk8d662xcy9521g?svg=true)](https://ci.appveyor.com/project/joliss/broccoli-source)

Broccoli plugin for creating "source" nodes that refer to physical file system
directories.

## Example Usage

In `Brocfile.js`:

```js
const { WatchedDir, UnwatchedDir } = require('broccoli-source');

// Refers to the ./lib directory on disk, and watches it.
const lib = new WatchedDir('lib');
// Note: this is equivalent to the deprecated plain-string syntax:
// const lib = 'lib';

// Refers to the ./bower_components/jquery directory, but does not watch it.
const jquery = new UnwatchedDir('bower_components/jquery');
```

## Reference

### `new WatchedDir(directoryPath, options)`

Create a Broccoli node referring to a directory on disk. The Broccoli watcher
used by `broccoli serve` will watch the directory and all subdirectories, and
trigger a rebuild whenever something changes.

* `directoryPath`: A path to a directory, either absolute, or relative to the
  working directory (typically the directory containing `Brocfile.js`).

  The directory must exist, or Broccoli will abort.

* `options`:
     * `annotation`: A human-readable description for this node.

### `new UnwatchedDir(directoryPath, options)`

Same as `WatchedDir`, but the directory will not be watched.

This can be useful for performance reasons. For example, say you want to refer
to a large directory hierarchy of third-party code in your `Brocfile.js`. Such
third-party code is rarely edited in practice. Using `UnwatchedDir` instead of
`WatchedDir` saves the overhead of setting up useless file system watchers.

When in doubt, use `WatchedDir` instead.

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