![Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack](https://cdn.sanity.io/images/cgdhsj6q/production/6af25114feaaac7179b18127c83327568ff592d1-1024x1024.webp?w=800&fit=max&auto=format)
Security News
Namecheap Takes Down Polyfill.io Service Following Supply Chain Attack
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
app-root
Advanced tools
Readme
Returns a list of candidate root files for CommonJS or AMD JavaScript applications within a directory.
A root/entry-point file is one that has dependencies but is not depended on (i.e., no other file requires it).
This is useful for automatically deducing the entry point for r.js or browserify configurations.
npm install app-root
var getAppRoot = require('app-root');
// Find the application roots within the js folder
getAppRoot('./js', function (roots) {
...
})
Or via a shell command
approot directory
directory
is the directory containing roots you'd like to identifySupply an options object as the second parameter.
Supported options:
ignoreDirectories
: list of directory names (strings or regex) to ignoreignoreFiles
: list of file names (strings or regex) to ignoreThese lists will be managed by an exclusion-manager.
Directory or filenames that match elements of the above lists will be ignored when looking for candidate app roots.
Otherwise, you'd end up with junk roots for 3rd party libraries/dependencies.
var options = {
ignoreDirectories: [/.+_components/, 'vendor', 'node_modules', '.git'],
ignoreFiles: ['Gruntfile.js']
};
getAppRoot('./js', options, function (roots) {
...
})
FAQs
Find the entry-point/root file of a front-end application
The npm package app-root receives a total of 19 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
Polyfill.io has been serving malware for months via its CDN, after the project's open source maintainer sold the service to a company based in China.
Security News
OpenSSF is warning open source maintainers to stay vigilant against reputation farming on GitHub, where users artificially inflate their status by manipulating interactions on closed issues and PRs.
Security News
A JavaScript library maintainer is under fire after merging a controversial PR to support legacy versions of Node.js.