An analysis tool to determine which migration path from AngularJS to Angular is right for you.
Switch branches/tags
Nothing to show
Clone or download
Kevin Feinberg and ellamaolson feat(analysisTool): Add support for counting AngularJS @component() d…
…ecorators, which are available through various 3rd party libraries to help mimic the Angular code style. It doesn't matter specifically which one is used. Just that the real deal from Angular is ignored since this tool supports hybrid apps. Addresses #9.
Latest commit 61e2469 Aug 20, 2018

ngMigration Assistant

ngMigration Assistant is an easy-to-use command line utility that scans an AngularJS application and recommends how to migrate to Angular.


Getting Started


Whether you are using npm or yarn package manager, install ngma globally.

npm install -g ngma
yarn global add ngma

Run the program

ngMigration Assistant will scan the current working directory or the input directory.

ngma <your_angularjs_app>

App Composition

Class: analysisTool

Runs the analysis on the provided directory and returns a recommendation on which migration path to take to Angular. It looks at the complexity, source lines of code (sloc), antipatterns, AngularJS version, and preparation necessary for migration. It identifies the files that need to be modified and the specific changes that will prepare the app for upgrading.


  • buildPathIgnoringGlobs() Builds a new filesystem by removing files matching the ignore globs using glob. Returns as an array of the new filesystem.
  • getGlobsFromGitignore() Parses .gitignore file into an array of globs and appends default globs to the array. Filters out patterns starting with ! from the array because ! means to never ignore. Returns the globs to ignore.
  • countLinesOfCode() asynchronous Counts sloc using node-sloc to traverse new filesystem returned by buildPathIgnoringGlobs(). Returns a promise that resolves to sloc.
  • runAnalysis() Traverses through filtered filesystem returned by buildPathIgnoringGlobs() and calls testFile() to run the individual tests.
  • runAntiPatternReport() asynchronous Creates the anti-pattern report and calculates the rewriteThreshold runRecommendation() uses. Each time an anti-pattern is found, general instructions and files needing corrections are appended to the preparation report. Returns a promise that resolves to the preparation report.
  • runRecommendation() asynchronous Recommendation algorithm that checks type of application (AngularJS, Angular, or hybrid), checks if sloc is under the rewriteThreshold, and checks if passes the ngUpgrade requirements. Returns a recommendation and preparation report.

Built With


Elana Olson - ellamaolson


Copyright Google Inc. All Rights Reserved. Use of this source code is governed by an MIT-style license that can be found in the LICENSE file at