Skip to content
PluginStats

babel-plugin-parameter-decorator weekly downloads statistics

By WarnerHooh · npm · Babel plugins

Function parameter decorator transform plugin for babel v7, just like typescript.

View on npm Outdated · Oct 29, 2026

babel-plugin-parameter-decorator has 42,741 recorded weekly downloads on npm, an increase of 28.7% over the past 30 days, ranking #827 of 3,247 tracked listings.

Weekly downloads
42,741
Official API · Dec 5, 2026
7-day growth
+21.3%
+7.5K weekly downloads
30-day growth
+28.7%
+9.5K weekly downloads
90-day growth
-46.4%
-37.1K weekly downloads
Rank
#827
▲ 26 in 7 days

About babel-plugin-parameter-decorator

Babel Plugin Parameter Decorator

Function parameter decorator transform plugin for babel v7, just like typescript parameter decorator

function validate(target, property, descriptor) {
  const fn = descriptor.value;

  descriptor.value = function (...args) {
    const metadata = `meta_${property}`;
    target[metadata].forEach(function (metadata) {
      if (args[metadata.index] === undefined) {
        throw new Error(`${metadata.key} is required`);
      }
    });

    return fn.apply(this, args);
  };

  return descriptor;
}

function required(key) {
  return function (target, propertyKey, parameterIndex) {
    const metadata = `meta_${propertyKey}`;
    target[metadata] = [
      ...(target[metadata] || []),
      {
        index: parameterIndex,
        key
      }
    ]
  };
}

class Greeter {
  constructor(message) {
    this.greeting = message;
  }

  @validate
   greet(@required('name') name) {
    return "Hello " + name + ", " + this.greeting;
  }
}
NOTE:

This package depends on @babel/plugin-proposal-decorators.

Installation & Usage

npm install @babel/plugin-proposal-decorators babel-plugin-parameter-decorator -D

And the .babelrc looks like:

{
    "plugins": [
        ["@babel/plugin-proposal-decorators", { "legacy": true }],
        "babel-plugin-parameter-decorator"
    ]
}

By default, @babel/preset-typescript will remove imports only referenced in Decorators. Since this is prone to break Decorators, make sure disable it by setting onlyRemoveTypeImports to true:

{
  ...
  "presets": [
    [
      "@babel/preset-typescript",
      { "onlyRemoveTypeImports": true }
    ]
  ]
  ...
}

Additional

If you'd like to compile typescript files by babel, the file extensions .ts or .tsx expected, or we will get runtime error!

🎊 Hopefully this plugin would get along with typescript private/public keywords in constructor. For example,

@Factory
class Greeter {
  
  private counter: Counter = this.sentinel.counter;
  
  constructor(private greeting: string, @Inject(Sentinel) private sentinel: Sentinel) {
  }

  @validate
  greet(@required('name') name: string) {
    return "Hello " + name + ", " + this.greeting;
  }
  
  count() {
    return this.counter.number;
  }
}

And your .babelrc looks like:

{
  "presets": [
    "@babel/preset-env",
    "@babel/preset-typescript"
  ],
  "plugins": [
    ["@babel/plugin-proposal-decorators", { "legacy": true }],
    ["@babel/plugin-proposal-class-properties", { "loose" : true }],
    "babel-plugin-parameter-decorator"
  ]
}

Description from the npm listing.

  • babel
  • babel-plugin
  • function
  • parameter
  • decorators
  • typescript

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

babel-plugin-parameter-decorator weekly downloads on npm, last 90 days: 42,741 weekly downloads as of Dec 5, 2026, -46.4% over 90 days.babel-plugin-parameter-decoratorWeekly downloads on npm · Last 90 days42,741downloads / week-46.4% over 90 days020K40K60K80K100K120K140K160KSep 6Sep 21Oct 6Oct 21Nov 5Nov 20Dec 5downloads / weekobservedarchived (Internet Archive)no observationsSep 7, 2026 – Dec 5, 2026 · 90 observations · Updated Dec …pluginstats.com
babel-plugin-parameter-decorator weekly downloads on npm, last 90 days: 42,741 weekly downloads as of Dec 5, 2026, -46.4% over 90 days.

7/30/90-day growth

babel-plugin-parameter-decorator weekly downloads growth on npm: +21.3% over 7 days, +28.7% over 30 days, -46.4% over 90 days.babel-plugin-parameter-decoratorWeekly downloads growth on npm42,741downloads / week now7-day growth+7,506 weekly downloads+21.3%30-day growth+9,537 weekly downloads+28.7%90-day growth-37,050 weekly downloads-46.4%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
babel-plugin-parameter-decorator weekly downloads growth on npm: +21.3% over 7 days, +28.7% over 30 days, -46.4% over 90 days.

Ranking history

babel-plugin-parameter-decorator npm ranking history: currently #827 (by weekly downloads).babel-plugin-parameter-decoratornpm ranking · by weekly downloads · Last 90 days#827current rank#200#300#400#500#600#700#800#900#1000Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 24 observations · Updated Dec 5, 2026pluginstats.com
babel-plugin-parameter-decorator npm ranking history: currently #827 (by weekly downloads).

Listing placement

All npm3,247 listings · 163 pages · 1,084 shown · page 42, #7 (overall #827)
All npm: every listing in weekly downloads order

Listing placement

Babel plugins263 listings · 14 pages · page 13, #16 (overall #256)
Babel 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 (592)
Recent weekly downloads observations for babel-plugin-parameter-decorator
Date (UTC)Weekly downloadsChange vs. previous
42,741-1.6K
44,385+3K
41,349+2K
39,330+3.5K
35,818+1.4K
34,461-324
34,785-450
35,235-1.1K
36,329-1.2K
37,530-1.4K
38,959-1.1K
40,051+944
39,107+1.6K
37,547—

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/babel-plugin-parameter-decorator. First seen Oct 16, 2026; last successful collection Oct 29, 2026. See the methodology.