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

@stackline/remark-message-control

v1.0.2

Published

remark plugin to enable, disable, and ignore messages with remark

Readme

@stackline/remark-message-control

remark plugin to enable, disable, and ignore messages with remark.

npm version license GitHub repository Docs Reddit community

Documentation | npm | Issues | Repository

Current package version: 1.0.2


Why this package?

@stackline/remark-message-control is the Stackline-maintained distribution of [email protected]. It is an independent continuation of remark-message-control; original authors and licenses remain credited below.

Compatibility

| Item | Value | | :--- | :--- | | Package | @stackline/[email protected] | | API target | [email protected] | | Supported Node.js | See supported framework requirements | | License | MIT | | Module type | module | | Main entry | index.js | | Types | index.d.ts | | Runtime dependencies | vfile, unified, @types/mdast, mdast-comment-marker, unified-message-control |

Installation

npm install @stackline/remark-message-control

Preserve existing imports and plugin resolution with an npm alias:

npm install remark-message-control@npm:@stackline/remark-message-control

Usage and API reference

remark-message-control

remark plugin to enable, disable, and ignore messages.

Contents

What is this?

This package is a unified (remark) plugin that lets authors write comments in markdown to show and hide messages.

unified is a project that transforms content with abstract syntax trees (ASTs). remark adds support for markdown to unified. mdast is the markdown AST that remark uses. remark plugins can inspect the tree and emit warnings and other messages. This is a remark plugin that gives authors the ability to configure those messages from markdown.

When should I use this?

You can use this package when you’re building a linter such as remark-lint. But you probably don’t need to, because remark-lint already exists and it uses this package.

Install

This package is ESM only. In Node.js (version 12.20+, 14.14+, or 16.0+), install with npm:

npm install @stackline/remark-message-control

In Deno with Skypack:

import remarkMessageControl from 'https://cdn.skypack.dev/remark-message-control@7?dts'

In browsers with Skypack:

<script type="module">
  import remarkMessageControl from 'https://cdn.skypack.dev/remark-message-control@7?min'
</script>

Use

Say we have the following file example.md:



## Heading

And our module example.js looks as follows:

import {read} from 'to-vfile'
import {reporter} from 'vfile-reporter'
import {remark} from 'remark'
import remarkMessageControl from '@stackline/remark-message-control'

main()

async function main() {
  const file = await remark()
    .use(() => (tree, file) => {
      file.message('Whoops!', tree.children[1], 'foo:thing')
    })
    .use(remarkMessageControl, {name: 'foo'})
    .process(await read('example.md'))

  console.error(reporter(file))
}

Now running node example.js yields:

example.md: no issues found

API

This package exports no identifiers. The default export is remarkMessageControl.

unified().use(remarkMessageControl, options)

Plugin to enable, disable, and ignore messages.

options

Configuration (required).

options.name

Name of markers that can control the message sources (string).

For example, {name: 'alpha'} controls alpha markers:

options.known

List of allowed ruleIds (Array<string>, optional). When given, a warning is shown when someone tries to control an unknown rule.

For example, {name: 'alpha', known: ['bravo']} results in a warning if charlie is configured:

options.reset

Whether to treat all messages as turned off initially (boolean, default: false).

options.enable

List of ruleIds to initially turn on if reset: true (Array<string>, optional). All rules are turned on by default (reset: false).

options.disable

List of ruleIds to turn on if reset: false (Array<string>, optional).

options.sources

Sources that can be controlled with name markers (string or Array<string>, default: options.name).

Syntax

This plugin looks for comments in markdown (MDX is also supported). If the first word in those comments does not match options.name, the comment is skipped. The second word is expected to be disable, enable, or ignore. Further words are rule identifiers of messages which are configurated.

In EBNF, the grammar looks as follows:

Which keyword is used defines how messages with those rule identifiers are handled:

disable

The disable keyword turns off all messages of the given rule identifiers. When without identifiers, all messages are turned off.

For example, to turn off certain messages:



*   **foo**

A paragraph, and now another list.

  * __bar__
enable

The enable keyword turns on all messages of the given rule identifiers. When without identifiers, all messages are turned on.

For example, to enable certain messages:



**foo** and __bar__.
ignore

The ignore keyword turns off all messages of the given ruleIds occurring in the following node. When without ruleIds, all messages are ignored.

Messages are turned on again after the end of the following node.

For example, to turn off certain messages for the next node:



*   **foo**
  * __bar__

Types

This package is fully typed with TypeScript. An extra Options type is exported which models the interface of the accepted options.

Compatibility

Projects maintained by the unified collective are compatible with all maintained versions of Node.js. As of now, that is Node.js 12.20+, 14.14+, and 16.0+. Our projects sometimes work with older versions, but this is not guaranteed.

This plugin works with unified version 6+ and remark version 7+.

Security

Use of remark-message-control does not involve rehype (hast) or user content so there are no openings for cross-site scripting (XSS) attacks. Messages may be hidden from user content though, causing builds to fail or pass, or changing a report.

Related

Contribute

See contributing.md in remarkjs/.github for ways to get started. See support.md for ways to get help.

This project has a code of conduct. By interacting with this repository, organization, or community you agree to abide by its terms.

License

MIT © Titus Wormer

Credits and original authors

Original copyright, license notices and contributor acknowledgements remain part of this distribution. Stackline maintenance does not replace authorship of the original work.

Community and Links

Use this repository's issue tracker for reproducible bugs and feature requests. Join r/Stackline for examples, usage questions and release discussions.