Skip to content
PluginStats

babel-plugin-angularjs-annotate weekly downloads statistics

By schmod · npm · Babel plugins

Babel plugin to add angularjs dependency injection annotations

View on npm Fresh · Dec 6, 2026

babel-plugin-angularjs-annotate has 139,270 recorded weekly downloads on npm, an increase of 3.0% over the past 30 days, ranking #584 of 3,247 tracked listings.

Weekly downloads
139,270
Official API · Dec 5, 2026
7-day growth
+0.2%
+318 weekly downloads
30-day growth
+3.0%
+4K weekly downloads
90-day growth
+32.4%
+34K weekly downloads
Rank
#584
▼ 18 in 7 days

About babel-plugin-angularjs-annotate

babel-plugin-angularjs-annotate

Circle CI npm version

Fork of ng-annotate for Babel users, with a focus on speed and ES6 support.

Adds Angular 1.x DI annotations to ES5/ES6 code being processed by Babel, with support for explicit annotations (/* @ngInject */), and automatic (implicit) annotation of typical Angular code patterns.

Fully compatible with ES5, transpiled ES6, and raw ES6 sources. Offers significantly reduced build times for projects already using Babel, compared to the standalone ng-annotate tool.

This plugin currently supports matching and transforming all of the patterns currently recognized by ng-annotate (explicit and implicit), and passes the relevant portions of ng-annotate's test suite.

Installation

Use like any other Babel plugin.

Most users will want to run

$ npm install babel-plugin-angularjs-annotate --save-dev

and add the plugin to your .babelrc file:

{
  "presets": ["@babel/preset-env"],
  "plugins": ["angularjs-annotate"]
}

Options

explicitOnly

By default, this plugin will attempt to add annotations to common AngularJS code patterns. This behavior can be disabled (requiring you to mark up functions with /* @ngInject */ or 'ngInject').

To pass this option to the plugin, add it to your Babel configuration:

{
  "presets": ["@babel/preset-env"],
  "plugins": [["angularjs-annotate", { "explicitOnly" : true}]]
}

Usage

See ng-annotate's documentation and the test sources for details about the patterns that can be automatically detected by ng-annotate and this plugin, as well as information about how to explicitly mark functions and classes for annotation.

Try it out in your browser.

ES6 Annotations

This plugin can annotate some ES6 classes and arrow functions that are not supported by ng-annotate:

Implicit arrow function annotation

Arrow functions may be annotated anywhere that a "regular" function expression may be used.

NOTE: There are places where you shouldn't use arrow functions in an Angular application. Inside of an arrow function, the value of this is inherited from the lexical scope enclosing the function. For this reason, arrow functions should not be used to declare Angular services or providers.

If you choose to ignore this warning, we'll add the annotations to your services and providers anyway, but your application probably won't work. Future releases may treat this condition as an error.

angular.module("MyMod").controller("MyCtrl", ($scope, $timeout) => {});

Becomes:

angular.module("MyMod").controller("MyCtrl", ["$scope", "$timeout", ($scope, $timeout) => {}]);
Explicit arrow function annotation

Arrow functions may also be explicitly marked for annotation.

var x = /* @ngInject */ ($scope) => {};

Becomes:

var x = /* @ngInject */ ($scope) => {};
x.$inject = ["$scope"]
Implicit Class Annotation

If a class is declared as an Angular service or factory in the same file as it is declared, it will be annotated automatically:

class svc {
    constructor(dep1){
        this.dep1 = dep1;
    }
}
angular.module('MyMod').service('MySvc', svc);

Becomes:

class svc {
    constructor(dep1){
        this.dep1 = dep1;
    }
}
svc.$inject = ['dep1'];
angular.module('MyMod').service('MySvc', svc);
Explicit Class Annotation

If a class is exported and used in another file/module, it must be explicitly marked for injection:

/* @ngInject */
class svc {
  constructor(dep1){
      this.dep1 = dep1;
  }
}

Prologue directives may also be used here:

class svc {
  constructor(dep1){
      "ngInject";
      this.dep1 = dep1;
  }
}
Object Method Shorthand

Object methods can be written with the new shorthand syntax:

let foo = {
  bar($http){
    'ngInject';
  }
};
$stateProvider.state('myState', {
  controller($scope) {}
});
Exports

Exported functions and classes may be annotated. Exported functions must have names:

/* @ngInject */
export default function svc(dep1){}

Notes & Philosophy

This project/experiment does not seek to replace ng-annotate. However, it does seek to provide similar functionality for Angular 1.x developers who are already using Babel and/or writing code in ES6.

Because of some of the limitations presented by Babel's transformation process, this project does not aim to achieve feature parity, or provide identical output to ng-annotate. Notably, Babel does not preserve formatting and indentations like ng-annotate does, and this project does not seek to replicate the features of ng-annotate that remove or transform existing annotations.

Initially, I had hoped to make very few modifications to the upstream sources, in the hopes of eventually merging babel support directly into ng-annotate. Unfortunately, Babylon appears to have diverged too far from Acorn to make that goal realistic. (I would love to be wrong here, and would welcome contributions that close the gap between the two projects!)

To run tests:
npm test

License

MIT, see LICENSE file.…

Description from the npm listing.

  • angular
  • angularjs
  • di
  • dependency
  • injection
  • annotate
  • annotation
  • annotations
  • transformation
  • babel-plugin

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-angularjs-annotate weekly downloads on npm, last 90 days: 139,270 weekly downloads as of Dec 5, 2026, +32.4% over 90 days.babel-plugin-angularjs-annotateWeekly downloads on npm · Last 90 days139,270downloads / week+32.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-angularjs-annotate weekly downloads on npm, last 90 days: 139,270 weekly downloads as of Dec 5, 2026, +32.4% over 90 days.

7/30/90-day growth

babel-plugin-angularjs-annotate weekly downloads growth on npm: +0.2% over 7 days, +3.0% over 30 days, +32.4% over 90 days.babel-plugin-angularjs-annotateWeekly downloads growth on npm139,270downloads / week now7-day growth+318 weekly downloads+0.2%30-day growth+4,006 weekly downloads+3.0%90-day growth+34,042 weekly downloads+32.4%Growth vs. nearest observation to each baseline date · Updated Dec 5, 2026pluginstats.com
babel-plugin-angularjs-annotate weekly downloads growth on npm: +0.2% over 7 days, +3.0% over 30 days, +32.4% over 90 days.

Ranking history

babel-plugin-angularjs-annotate npm ranking history: currently #584 (by weekly downloads).babel-plugin-angularjs-annotatenpm ranking · by weekly downloads · Last 90 days#584current rank#540#550#560#570#580#590Sep 7Sep 22Oct 7Oct 22Nov 6Nov 21Dec 6rankOct 18, 2026 – Dec 6, 2026 · 44 observations · Updated Dec 5, 2026pluginstats.com
babel-plugin-angularjs-annotate npm ranking history: currently #584 (by weekly downloads).

Listing placement

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

Listing placement

Babel plugins263 listings · 14 pages · page 12, #14 (overall #234)
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 (170)
Recent weekly downloads observations for babel-plugin-angularjs-annotate
Date (UTC)Weekly downloadsChange vs. previous
139,270-551
139,821+358
139,463+3.4K
136,071+336
135,735+452
135,283-3.2K
138,519-433
138,952+108
138,844-2.5K
141,347-2.3K
143,600-3.2K
146,829+109
146,720+3.3K
143,422—

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