@steinringer/resource-usage-analyzer
v1.0.2
Published
Finds all resources used in *.js files in a Portego solution
Downloads
2
Keywords
Readme
Resource Usage Analyzer
Finds all resources used in *.js files in a Portego solution
Install
npm install --save @steinringer/resource-usage-analyzer
or
yarn add @steinringer/resource-usage-analyzer
Usage
const resourceUsageAnalyzer = require('@steinringer/resource-usage-analyzer');
resourceUsageAnalyzer({
rootDir : 'c:/_dev/portego2_dev'
})
.then(({
resources,
errors
}) => {
console.log(resources);
console.error(errors);
});
settings
rootDir
: root directory where to search for filesfileGlobs
: [optional] array of globs that defines files to be includedignoreGlobs
: [optional] array of globs that defines files to be excluded.outFile
: [optional] file where should be list saved.
defaults :
{
fileGlobs: [
'**/*.js'
],
ignoreGlobs: [
'**/*.test.js',
'**/*.spec.js',
'**/*.mock.js',
'**/node_modules/**',
'**/localizationProviderTemplate.js',
'**/packageDataProviderTemplate.js',
],
}
return value
function returns promise, that resolves to object with:
resources
: list of resourceserrors
: list of all errors that has occurred during analysis