New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ngx-usage

Package Overview
Dependencies
Maintainers
1
Versions
12
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-usage

Count usage of components, pipes, providers and directives. Find possibly not used ones.

  • 0.3.0
  • unpublished
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
0
Maintainers
1
Weekly downloads
 
Created
Source

ngx-usage

cli tool for analyzing usage of Angular components, pipes, directives, services

What it can do for me?

  • list components most probably not used in your app
  • [ x] list components
  • list pipes, directives, services most probably not used in your app
  • list pipes,directives, providers usage summary
  • check if anything from imported modules is used in given module files
  • count usages of component/directive/pipe/service from given file in project
  • count usages of any component by selector/class name, i.e. from third party library
  • check if anything from imported modules is used in given module files

How does it work?

Using ts-morph files from project (provided by tsconfig file) are parsed and usage stats are counted.

Component usages are checked in templates of other components from project and component's class reference in other files from project.

Component is considered unused when it's selector is not used and class is only referenced in imports and Angular modules (declarations,exports,entryComponents); Usages in test files are skipped. Test files are identified by name, default regular expression for test file is /\.spec\.ts$/.

Usage

Install ngx-usage globally or use it via npx.

				Usage: ngx-usage [options] [command]

Options:
  -p, --project <path>          tsconfig file path (required)
  -V, --version                 output the version number
  -h, --help                    display help for command

Commands:
  components-unused             List components that are probably not used - referenced only in module (*.module.ts) and test (*.spec.ts) files
  components-summary [options]  List usage stats of all components defined in project
  help [command]                display help for command

Keywords

FAQs

Package last updated on 24 Mar 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc