Skip to content
PluginStats

enhance-visitors weekly downloads statistics

By jfmengels (4 listings) · npm · ESLint plugins

Enhance your ESLint visitors with shared logic

View on npm Fresh · Dec 6, 2026

enhance-visitors has 247,908 recorded weekly downloads on npm, an increase of 18.3% over the past 30 days, ranking #493 of 3,247 tracked listings.

Weekly downloads
247,908
Official API · Dec 5, 2026
7-day growth
+8.5%
+19.5K weekly downloads
30-day growth
+18.3%
+38.3K weekly downloads
90-day growth
+38.7%
+69.2K weekly downloads
Rank
#493
Among tracked npm listings

About enhance-visitors

enhance-visitors Build Status Coverage Status

Enhance your ESLint visitors with shared logic.

Install

$ npm install --save enhance-visitors

Purpose

The purpose of this tool is to simplify the writing of rules with common logic. Extract the common logic into a separate file, and then write rules to build on top.

Traversal order

For the enhancer, the traversal is done just as usual, one node at a time. The traversal is not done all at once for the enhancer, and then all at once for the rule implementation. Rather, it's done one Node at a time, first for the enhancer (or rather, whatever you put first ) but rather the

API

.mergeVisitors([visitors])

Merges multiple visitor objects, so that all visitors for a node type are ran one after the other, in first-to-last order. For <type>:exit visitors, they are traversed last-to-first.

visitors: object[]

An array of visitor objects, such as {CallExpression: fn1, Identifier: fn2, ...}.

Example
const enhance = require('enhance-visitors');

function log(message) {
  return function() {
    console.log(message);
  };
}

module.exports = function(context) {
  return enhance.mergeVisitors([
    {
      'CallExpression': log('1 - CallExpression entry'),
      'CallExpression:exit': log('1 - CallExpression exit')
    },
    {
      'CallExpression': log('2 - CallExpression entry'),
      'CallExpression:exit': log('2 - CallExpression exit')
    }
  ]);
}

Given the following code: foo(), it should print

1 - CallExpression entry
2 - CallExpression entry
2 - CallExpression exit
1 - CallExpression exit
Usage example: Detection of a package import

Let's say you have a npm package called unicorn, and that you are writing an ESLint plugin for it, so that users use it as intended and avoid pitfalls. You will write multiple rules for it, and most or all of them will need to know which variable references unicorn.

import uni from 'unicorn'; // <-- The variable `uni` references my package

In order not to have to write the same detection logic in every one of your rules, let's write an enhancer. In this example, we will write it in <root>/rules/core/unicornSeeker.js. We'll keep it simple and only detect an import using the import keyword and not using require, and then only with the ImportDefaultSpecifier syntax.

module.exports = function enhance(imports) {
  return {
    ImportDeclaration: function (node) {
      if (node.source.value === 'unicorn') {
        node.specifiers.forEach(function (specifier) {
          if (specifier.type === 'ImportDefaultSpecifier') {
            imports.unicorn = specifier.local.name;
          }
        });
      }
    }
  };
};

This visitors object will be traversed along and before your rule implementation. What it does is traverse your AST, find ImportDeclaration nodes, and store relevant information in imports. Then in your rule file (<root>/rules/no-unknown-methods.js, which detects methods that do not exist in the package), we'll have:

const enhance = require('enhance-visitors');
const unicornSeeker = require('./core/unicornSeeker');

const existingMethods = [
  'makeRainbow', 'trample', 'flyWithGrace'
];

module.exports = function (context) {
  const imports = {};

  return enhance.mergeVisitors([ // Noteworthy line 1
    unicornSeekerEnhancer(imports), // Noteworthy line 2
    {
      CallExpression: function (node) {
        const callee = node.callee;
        if (callee.type === 'MemberExpression' &&
          callee.object.type === 'Identifier' &&
          callee.object.name === imports.unicorn && // Noteworthy line 3
          callee.property.type === 'Identifier' &&
          existingMethods.indexOf(callee.property.name) === -1
        ) {
          context.report({
            node: node,
            message: 'Unknown `unicorn` method ' + callee.property.name
          });
        }
      }
    }
  ]);
};

It looks pretty much like a normal rule implementation, but there are a few differences. In Noteworthy line 1 & 2, we are merging the unicornSeeker enhancer we wrote earlier with the rule implementation. This will make unicornSeeker traverse the AST and collect information that we can then use like we did in Noteworthy line 3.

.visitIf([predicates])

Returns a function fn that takes a visitor function visitor. When fn is called (usually an AST node), visitor will get called with the same argument only if all predicates, also called with the same argument, return a truthy value.

This essentially allows writing less and/or shorter reusable conditions inside your visitor.

predicates: function[]

An array of predicate functions, that take a AST node as argument and return a boolean.

Example
const enhance = require('enhance-visitors');

function isRequireCall(node) {
  return node &&
    node.callee &&
    node.callee.type === 'Identifier' &&
    node.callee.name === 'require' &&
    node.arguments.length === 1 &&
    node.arguments[0].type === 'Literal';
}

module.exports = function(context) {
  return {
    CallExpression: enhance.visitIf([isRequireCall])(node => {
      if (node.arguments[0] !== 'unicorn') {
        context.report({
          node,
          message: 'You only need to use `unicorn`'
        })
      }
    })
  };
}

License

MIT © Jeroen Engels

Description from the npm listing.

  • eslint
  • plugin
  • eslint-plugin
  • eslintplugin
  • enhance
  • visitor
  • visitors
  • ast

README badge

Show your rank in a README or on your website. The badge updates automatically.

Charts

Images: 30d · 1y · all time · 1600×900 dark

Adoption over time

enhance-visitors weekly downloads on npm, last 90 days: 247,908 weekly downloads as of Dec 5, 2026, +38.7% over 90 days.enhance-visitorsWeekly downloads on npm · Last 90 days247,908downloads / week+38.7% over 90 days050K100K150K200K250K300KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
enhance-visitors weekly downloads on npm, last 90 days: 247,908 weekly downloads as of Dec 5, 2026, +38.7% over 90 days.

7/30/90-day growth

enhance-visitors weekly downloads growth on npm: +8.5% over 7 days, +18.3% over 30 days, +38.7% over 90 days.enhance-visitorsWeekly downloads growth on npm247,908downloads / week now7-day growth+19,491 weekly downloads+8.5%30-day growth+38,277 weekly downloads+18.3%90-day growth+69,185 weekly downloads+38.7%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
enhance-visitors weekly downloads growth on npm: +8.5% over 7 days, +18.3% over 30 days, +38.7% over 90 days.

Ranking history

enhance-visitors npm ranking history: currently #493 (by weekly downloads).enhance-visitorsnpm ranking · by weekly downloads · Last 90 days#493current rank#450#460#470#480#490#500#510Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
enhance-visitors npm ranking history: currently #493 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,083 shown · page 25, #13 (overall #493)
All npm: every listing in weekly downloads order

Listing placement

ESLint plugins290 listings · 15 pages · page 6, #10 (overall #110)
ESLint plugins: every listing in weekly downloads order

Filled points are observed values; hollow points come from Internet Archive snapshots of the listing page. Dashed segments span periods with no observations — values between points are not interpolated.

Each band is one page of 20. Weekly downloads on a linear scale. Placement is projected from weekly downloads, so it can differ from the marketplace's own sort order. Hover a dot to see the listing.

Recent observations

Full history (170)
Recent weekly downloads observations for enhance-visitors
Date (UTC)Weekly downloadsChange vs. previous
247,908+1.2K
246,753+7.1K
239,639+9K
230,611+4.6K
226,055+2.3K
223,763-2.2K
225,956-2.5K
228,417-10K
238,391-12.4K
250,758-10.5K
261,218-1.1K
262,297+4.2K
258,075+4.6K
253,519—

Similar npm ESLint plugins plugins

All 20 enhance-visitors alternatives

Data source

Weekly downloads (trailing 7 complete days) come from the official npm downloads API. Downloads include CI and mirrors and are not equivalent to installs or users. npm publishes no ratings.

Listing: https://www.npmjs.com/package/enhance-visitors. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.