npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

broccoli-node-info

v2.2.0

Published

Inspect Broccoli nodes; thin wrapper around node.__broccoliGetInfo__()

Downloads

2,188,743

Readme

broccoli-node-info

This is a low-level package used to communicate with Broccoli nodes (that is, plugin instances). It provides a thin wrapper around node.__broccoliGetInfo__(), normalizing different versions of the node API to the newest version.

This package is mainly used by the Broccoli Builder class, but it can also be used for inspecting nodes for testing, wrapping, diagnostics, or similar purposes. If you are tempted to call node.__broccoliGetInfo__() or access private variables on broccoli-plugin instances, such as node._name or node._inputNodes, then use this package instead!

For background on the Broccoli node API, see docs/node-api.md.

Usage

var broccoliNodeInfo = require('broccoli-node-info');

node = new SomeBroccoliPlugin();

var nodeInfo = broccoliNodeInfo.getNodeInfo(node);
// Now we can use nodeInfo.name, nodeInfo.annotation, etc.

getNodeInfo(node)

This function calls node.__broccoliGetInfo__(broccoliNodeInfo.features).

For node objects conforming to the most recent node API, it simply returns the resulting nodeInfo object.

For node object conforming to an older version of the node API, it provides compatibility code to normalize the nodeInfo object.

As a result, regardless of the API version used by the node object, we obtain a nodeInfo object conforming to the current specification in docs/node-api.md

This function throws a broccoliNodeInfo.InvalidNodeError when called with

  • a plain string node (while still supported by the Broccoli Builder, they are deprecated in favor of broccoli-source),
  • a node using the old .read/.rebuild API (see docs/broccoli-1-0-plugin-api.md), or
  • some other object that isn't a node.

InvalidNodeError

Error subclass, potentially thrown by getNodeInfo().

features

A hash of all supported feature flags. This hash acts like a version number for the node API. In the current version, its value is

{
  persistentOutputFlag: true,
  sourceDirectories: true
}