Skip to content
PluginStats

babel-plugin-transform-decorators-legacy weekly downloads statistics

By loganfsmyth · npm · Babel plugins

A plugin for Babel 6 that (mostly) replicates the old decorator behavior from Babel 5.

View on npm Fresh · Dec 6, 2026

babel-plugin-transform-decorators-legacy has 96,557 recorded weekly downloads on npm, a decrease of 17.1% over the past 30 days, ranking #642 of 3,247 tracked listings.

Weekly downloads
96,557
Official API · Dec 5, 2026
7-day growth
-2.9%
-2.9K weekly downloads
30-day growth
-17.1%
-19.9K weekly downloads
90-day growth
+1.4%
+1.3K weekly downloads
Rank
#642
▼ 17 in 7 days

About babel-plugin-transform-decorators-legacy

Babel Legacy Decorator plugin

This is a plugin for Babel 6 that is meant to replicate the old decorator behavior from Babel 5 in order to allow people to more easily transition to Babel 6 without needing to be blocked on updates to the decorator proposal or for Babel to re-implement it.

Babel >= 7.x

This plugin is specifically for Babel 6.x. If you're using Babel 7, this plugin is not for you. Babel 7's @babel/plugin-proposal-decorators officially supports the same logic that this plugin has, but integrates better with Babel 7's other plugins. You can enable this with

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

in your Babel configuration. Note that legacy: true is specifically needed if you want to get the same behavior as transform-decorators-legacy because there are newer versions of the decorator specification coming out, and they do not behave the same way as this plugin does.

Installation & Usage

$ npm install --save-dev babel-plugin-transform-decorators-legacy

Add the following line to your .babelrc file:

{
    "plugins": ["transform-decorators-legacy"]
}
NOTE: Order of Plugins Matters!

If you are including your plugins manually and using transform-class-properties, make sure that transform-decorators-legacy comes before transform-class-properties.

/// WRONG

"plugins": [
  "transform-class-properties",
  "transform-decorators-legacy"
]

// RIGHT

"plugins": [
  "transform-decorators-legacy",
  "transform-class-properties"
]

Why "legacy"?

Decorators are still only a relatively new proposal, and they are (at least currently) still in flux. Many people have started to use them in their original form, where each decorator is essentially a function of the form

function(target, property, descriptor){}

This form is very likely to change moving forward, and Babel 6 did not wish to support the older form when it was known that it would change in the future. As such, I created this plugin to help people transition to Babel 6 without requiring them to drop their decorators or requiring them to wait for the new proposal update and then update all their code.

Best Effort

This plugin is a best effort to be compatible with Babel 5's transpiler output, but there are a few things that were difficult to reproduce, and a few things that were simply incorrect in Babel 5 with respect to the decorators proposal.

Two main things to mention as differences, though not things you are likely to encounter:

  1. Decorators expressions are evaluated top to bottom, and executed bottom to top. e.g.

    function dec(id){
        console.log('evaluated', id);
        return (target, property, descriptor) => console.log('executed', id);
    }
    
    class Example {
        @dec(1)
        @dec(2)
        method(){}
    }
    

    In Babel 5, this would output:

    evaluated 2
    evaluated 1
    executed 2
    executed 1
    

    With this plugin, it will result in:

    evaluated 1
    evaluated 2
    executed 2
    executed 1
    

    which is what the spec dictates as the correct behavior and was incorrect in Babel 5.

  2. Static class property initializers are evaluated once up front.

    If you decorate a static class property, you will get a descriptor with an initializer property. However whereas with Babel 5 this could be re-executed multiple times with potentially differing results, decorators-legacy will precompute the value and return an initializer that will return that value. e.g.

    function dec(target, prop, descriptor){
        let {initializer} = descriptor;
        delete descriptor.initializer;
        delete descriptor.writable;
    
        descriptor.get = function(){
            return initializer.call(this);
        };
    }
    
    var i = 0;
    
    class Example {
        @dec
        static prop = i++;
    }
    

    In Babel 5, every access to prop would increment i. In Babel 6, the very first value of i will be cached for future initializer calls.

    The spec is a little vague around how initializers work for repeat calls, and I'd consider calling an initializer multiple times to be a mistake in general, so hopefully this will not cause anyone trouble.

License

MIT (c) 2015

Description from the npm listing.

  • babel
  • babel-plugin
  • es7
  • decorators

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-transform-decorators-legacy weekly downloads on npm, last 90 days: 96,557 weekly downloads as of Dec 5, 2026, +1.4% over 90 days.babel-plugin-transform-decorators-lega…Weekly downloads on npm · Last 90 days96,557downloads / week+1.4% over 90 days020K40K60K80K100K120K140KSep 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-transform-decorators-legacy weekly downloads on npm, last 90 days: 96,557 weekly downloads as of Dec 5, 2026, +1.4% over 90 days.

7/30/90-day growth

babel-plugin-transform-decorators-legacy weekly downloads growth on npm: -2.9% over 7 days, -17.1% over 30 days, +1.4% over 90 days.babel-plugin-transform-decorators-lega…Weekly downloads growth on npm96,557downloads / week now7-day growth-2,912 weekly downloads-2.9%30-day growth-19,894 weekly downloads-17.1%90-day growth+1,333 weekly downloads+1.4%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
babel-plugin-transform-decorators-legacy weekly downloads growth on npm: -2.9% over 7 days, -17.1% over 30 days, +1.4% over 90 days.

Ranking history

babel-plugin-transform-decorators-legacy npm ranking history: currently #642 (by weekly downloads).babel-plugin-transform-decorators-lega…npm ranking · by weekly downloads · Last 90 days#642current rank#100#200#300#400#500#600#700Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 17, 2026 – Dec 6, 2026 · 45 observations · Updated Dec 5, 2026pluginstats.com
babel-plugin-transform-decorators-legacy npm ranking history: currently #642 (by weekly downloads).

Listing placement

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

Listing placement

Babel plugins263 listings · 14 pages · page 13, #2 (overall #242)
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-transform-decorators-legacy
Date (UTC)Weekly downloadsChange vs. previous
96,557-360
96,917-1.4K
98,287+1.9K
96,434-58
96,492+509
95,983-1K
97,003-2.5K
99,469-3.9K
103,390-1.1K
104,500-2.6K
107,069-6K
113,102-3.6K
116,659+185
116,474—

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-transform-decorators-legacy. First seen Oct 16, 2026; last successful collection Dec 6, 2026. See the methodology.