Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

app-root

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

app-root

Find the entry-point/root file of any CommonJS or AMD JavaScript application

  • 1.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
8
decreased by-11.11%
Maintainers
1
Weekly downloads
 
Created
Source

Returns a list of candidate root files for CommonJS or AMD JavaScript applications within a directory by ranking each .js file based on its largest, cumulative, non-core degree (i.e., sum of non-core dependencies across the entire dependency graph).

npm install app-root

This is useful for automatically deducing the entry point for r.js or browserify configurations.

var getAppRoot = require('app-root');

// Find the application roots within the js folder
getAppRoot('./js', function (roots) {
  ...
})

TODO:

  • Accept option (as second param) object with subdirectories to ignore in directory traversal (i.e., node_modules, vendor, bower_components)
  • Otherwise, we'll get non-relevant roots

Keywords

FAQs

Package last updated on 21 Mar 2014

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