Aalexbit-codemod

angularjs-http-and-async

Mine AngularJS async APIs ($http, $resource, $q, $timeout, $interval); read-only metrics

miningmetricsangularjscode-miningmigration-assessmentasync_api_usage
PRO
0 executions
Use dashboard

Run locally

npx codemod angularjs-http-and-async

This is a Pro codemod. Preview changes and insights for free, no login or code sharing required. Applying changes and accessing insights requires a paid plan and sign in.Learn more

angularjs-http-and-async

Read-only mining codemod that detects AngularJS async/data-access service usage in JavaScript sources and emits async_api_usage metrics. No files are written to the target repo.

What it does

Scans .js/.jsx/.ts/.tsx files for identifier occurrences of the following AngularJS services — as the object of a member access ($http.get(...)), a direct call ($timeout(...)), an assignment (this.$http = $http), or a dependency-injection parameter name (inline or array-annotated DI):

APIRiskAutomationEffort pointsNotes
$httplowfull3Maps mechanically onto Angular's HttpClient
$timeoutlowfull1Maps onto setTimeout / RxJS timer
$intervallowfull1Maps onto setInterval / RxJS interval
$resourcemediumpartial5No direct Angular equivalent; needs a hand-written service/HttpClient calls
$qmediumpartial5Promise/RxJS chains usually need redesign, not a 1:1 rewrite

Metrics

MetricCardinalities
async_api_usagefile, line, snippet, api, migration_category (service), risk, automation, effort_points, recommended_phase

Installation

bash

Development

bash

License

MIT

Ready to contribute?

Build your own codemod and share it with the community.