@steinringer/resource-usage-analyzer
Finds all resources used in *.js files in a Portego solution
Last updated 2 months ago by pruttned .
ISC · Repository · Bugs · Original npm · Tarball
$ cnpm install @steinringer/resource-usage-analyzer 
SYNC missed versions from official npm registry.

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 files
  • fileGlobs : [optional] array of globs that defines files to be included
  • ignoreGlobs : [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 resources
  • errors : list of all errors that has occurred during analysis
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 3
Dependencies (6)
Dev Dependencies (3)
Dependents (0)
None

Copyright 2014 - 2017 © taobao.org |