Socket
Socket
Sign inDemoInstall

karma-extractor

Package Overview
Dependencies
4
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    karma-extractor

Extract informations (path to js, app name) from index.html to make karma.conf.js more sustainable/maintainable


Version published
Weekly downloads
3
increased by50%
Maintainers
1
Created
Weekly downloads
 

Readme

Source

karma-extractor

Extract informations (path to js, app name) from index.html to make karma.conf.js more sustainable/maintainable.

Without karma-extractor, as soon as you add a dependency to your index.html, you also need to add them to your karma.conf.js in the files argument.

A solution to avoid this issue is to add all files to your karma.conf.js but your tests don't reflect reality.

With karma-extractor, your tests have exactly the same dependencies than your real project, at any time.

Getting started


var extractor = require('karma-extractor');

// asynchronous without options
extractor.extract('index.html', function (err, infos) {
    // infos.appName
    // infos.files
});

var options = {
    ignore: ['/socket.io/socket.io.js', 'https://*'], // default = [], use minimatch regex
    prefixes: { // default = {}
        '/bower_components/': '../bower_components'
    }
};

// asynchronous without options
extractor.extract('index.html', options, function (err, infos) {
    // infos.appName
    // infos.files
});

// synchronous
try {
    var infos = extractor.extractSync('index.html', options);
} catch (e) {

}


Keywords

FAQs

Last updated on 06 Sep 2016

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc