Security News
Input Validation Vulnerabilities Dominate MITRE's 2024 CWE Top 25 List
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
broccoli-source
Advanced tools
Broccoli plugin for referring to source directories on the file system
The broccoli-source npm package provides utilities for working with Broccoli nodes, which are the fundamental building blocks in the Broccoli build tool. It helps in creating and managing source nodes, which represent input files or directories in a Broccoli build pipeline.
createSourceNode
This feature allows you to create a source node from a given directory. The 'src' directory is used as the input for the build pipeline.
const { createSourceNode } = require('broccoli-source');
const node = createSourceNode('src');
wrapSourceNode
This feature wraps an existing source node, which can be useful for adding additional metadata or transformations to the node.
const { wrapSourceNode } = require('broccoli-source');
const node = wrapSourceNode('src');
Broccoli-funnel is a similar package that allows you to filter and include/exclude files from a source node. It provides more granular control over the files that are passed through the build pipeline compared to broccoli-source.
Broccoli-merge-trees is another package that allows you to merge multiple source nodes into a single node. This is useful for combining different sets of files or directories into one cohesive output, which is a different but complementary functionality to what broccoli-source offers.
Broccoli plugin for creating "source" nodes that refer to physical file system directories.
In Brocfile.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');
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.
FAQs
Broccoli plugin for referring to source directories on the file system
The npm package broccoli-source receives a total of 523,792 weekly downloads. As such, broccoli-source popularity was classified as popular.
We found that broccoli-source demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
MITRE's 2024 CWE Top 25 highlights critical software vulnerabilities like XSS, SQL Injection, and CSRF, reflecting shifts due to a refined ranking methodology.
Security News
In this segment of the Risky Business podcast, Feross Aboukhadijeh and Patrick Gray discuss the challenges of tracking malware discovered in open source softare.
Research
Security News
A threat actor's playbook for exploiting the npm ecosystem was exposed on the dark web, detailing how to build a blockchain-powered botnet.