broccoli-node-info is a low-level JavaScript utility package designed to interact with Broccoli.js plugin instances (nodes). Its primary function is to provide a thin, normalized wrapper around the `node.__broccoliGetInfo__()` internal API, abstracting away differences between various Broccoli node API versions to consistently return a `nodeInfo` object conforming to the latest specification. This package is primarily leveraged by the core Broccoli `Builder` class but is also invaluable for developers performing node inspection, testing, diagnostics, or creating wrappers, offering a safer alternative to directly accessing private node variables like `_name` or `_inputNodes`. The current stable version is 2.2.0, with recent updates like 2.0.0 and 2.1.0 indicating active maintenance and compatibility updates, such as tracking input changes and support for the `volatile` option. Its release cadence aligns with major Broccoli.js ecosystem updates, ensuring it remains a foundational piece for interacting with Broccoli nodes programmatically.
npm install broccoli-node-infoVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use `getNodeInfo` to safely extract information from a Broccoli plugin instance, including handling potential `InvalidNodeError`.
Upgrade your Node.js environment to version 8 or higher to ensure compatibility with `broccoli-node-info` v2 and above.
For source directories, use `broccoli-source` instances instead of plain strings. Ensure any custom Broccoli plugins adhere to the latest Broccoli node API specification.
Always use `broccoli-node-info.getNodeInfo(node)` to safely inspect Broccoli nodes and retrieve their information in a future-proof manner.
If the string represents a source directory, use `broccoli-source` to create a proper source node. Otherwise, ensure the argument is a valid Broccoli plugin instance.
Verify that the object passed to `getNodeInfo` is an instance of a Broccoli plugin that conforms to the current node API specification. For legacy nodes, consider updating them to the latest API.
No dependency data recorded yet.