
Security News
Deno 2.2 Improves Dependency Management and Expands Node.js Compatibility
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Returns a list of application entry points for front-end applications (JS and Sass).
npm install app-root
An entry point (i.e., root) is a file that no other file requires/imports.
Works with AMD, CommonJS, ES6, and SASS apps.
This library is particularly useful for automatically deducing the entry point for r.js or browserify configurations as done in YA.
A directory may have many roots. This is true if you have multiple apps within a single directory or if your app uses a multi-bundle architecture (where each page on your site has its own JS app).
var getAppRoot = require('app-root');
// Find the application roots within the js folder
getAppRoot({
directory: './js',
success: function (roots) {
...
}
});
With configurable options:
getAppRoot({
directory: './js',
success: function (roots) {
...
},
ignoreDirectories: [/.+_components/, 'vendor', 'node_modules', '.git'],
ignoreFiles: ['Gruntfile.js'],
includeNoDependencyModules: true,
config: 'path/to/my/requirejs/config.js'
});
ignoreDirectories
: list of directory names (strings or regex) to ignoreignoreFiles
: list of file names (strings or regex) to ignoreincludeNoDependencyModules
: (default false) Whether or not to include, as potential roots, modules that have no dependenciesconfig
: path to your module loader configuration (for resolving aliased module paths)Or via a shell command
approot directory
directory
is the directory containing roots you'd like to identifyFAQs
Find the entry-point/root file of a front-end application
The npm package app-root receives a total of 8 weekly downloads. As such, app-root popularity was classified as not popular.
We found that app-root demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
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.
Security News
Deno 2.2 enhances Node.js compatibility, improves dependency management, adds OpenTelemetry support, and expands linting and task automation for developers.
Security News
React's CRA deprecation announcement sparked community criticism over framework recommendations, leading to quick updates acknowledging build tools like Vite as valid alternatives.
Security News
Ransomware payment rates hit an all-time low in 2024 as law enforcement crackdowns, stronger defenses, and shifting policies make attacks riskier and less profitable.