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 🙏

© 2026 – Pkg Stats / Ryan Hefner

nuclide-diagnostics-provider-base

v0.0.35

Published

Utilities to make implementing a diagnostics provider easier

Readme

nuclide-diagnostics-provider-base

This package is for developers wishing to integrate with the nuclide-diagnostics packages. If you simply want to view diagnostics in Atom, look at the end-user docs.

This package solves some common problems for diagnostics providers. It manages consumer subscriptions and also subscribes to the appropriate text editor events, such as file save.

Take a look at our sample diagnostics provider to see this in action.

The DiagnosticsProviderBase constructor takes a single argument: A ProviderBaseOptions object.

type ProviderBaseOptions = {
  /** The callback by which a provider is notified of text events, such as a file save. */
  onTextEditorEvent?: (editor: TextEditor) => mixed;
  /**
   * The callback by which a provider is notified that a new consumer has subscribed to diagnostic
   * updates.
   */
  onNewUpdateSubscriber?: (callback: MessageUpdateCallback) => mixed;
  /**
   * The callback by which a provider is notified that a new consumer has subscribed to diagnostic
   * invalidations.
   */
  onNewInvalidateSubscriber?: (callback: MessageInvalidationCallback) => mixed;
  /**
   * If true, this will cause onTextEditorEvent to get called more often -- approximately whenever
   * the user stops typing. If false, it will get called only when the user saves.
   */
  shouldRunOnTheFly?: boolean;
  /**
   * The following two options specify which grammars the provider is interested in. Most providers
   * will include a set of grammarScopes, and will therefore get notifications only about
   * TextEditors that are associated with those grammarScopes. Instead, a provider may set
   * enableForAllGrammars to true, and then it will get notified of changes in all TextEditors. If
   * enableForAllGrammars is true, it overrides the grammars in grammarScopes.
   */
  grammarScopes?: Set<string>;
  enableForAllGrammars?: boolean;
}

A provider should delegate to a DiagnosticsProviderBase object once it is constructed.

A provider should call providerBase.publishMessageUpdate(update) and providerBase.publishMessageInvalidation(invalidation) when they wish to publish messages. In most cases, these should be called, directly or indirectly, from the callback passed as onTextEditorEvent in the options.

A provider may call providerBase.setRunOnTheFly(runOnFly) to alter this setting after it has been constructed. This is useful if you would like to provide a setting to allow users to change this at will.

A provider should delegate to providerBase.onMessageUpdate(callback) and providerBase.onMessageInvalidation(callback) to allow the provider base to manage event subscriptions.