npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

karma-webpack-bundle

v1.3.3

Published

A personalized bundle of karma libraries and configs

Downloads

145

Readme

Karma Webpack Bundle

A personalized bundle of karma libraries and configs

npm deps size vulnerabilities license

Installation

npm install karma-webpack-bundle --save-dev

benchSettings : object

Settings object for karma-benchmark. I don't see any need for benchmarks to run for 5 seconds, so I've provided settings that run the benchmark for 200ms.

Properties

| Name | Type | Default | | --- | --- | --- | | [maxTime] | number | 0.2 | | [minTime] | number | 0.2 | | [minSamples] | number | 1 | | [delay] | number | 0 | | [async] | boolean | true |

Example

const {benchSettings} = require('karma-webpack-bundle');

benchmark('how fast is this', () => {
    [1, 2, 3].map((x) => x * 2);
}, benchSettings);

eslintrcBench : object

An eslint config object that overrides various rules from the main config for bench files.

Example
Create a file in your bench directory called .eslintrc.cjs:

const { eslintrcBench } = require('karma-webpack-bundle');

module.exports = eslintrcBench;

eslintrc : object

An eslint config object intended to live in the root of your project.

Example
Create a file in the root of your project called .eslintrc.cjs:

const { eslintrc } = require('karma-webpack-bundle');

module.exports = eslintrc;

eslintrcTests : object

An eslint config object that overrides various rules from the main config for test files.

Example
Create a file in your tests directory called .eslintrc.cjs:

const { eslintrcTests } = require('karma-webpack-bundle');

module.exports = eslintrcTests;

formatBenchmark(benchmark, browser, config) ⇒ string

A plugin for the karma-benchmarkjs-reporter formatBenchmark option. Only current difference with the default formatter is the hz number is passed through toLocaleString to make the number more readable. This is used in karmaBenchConfig.

| Param | Type | Description | | --- | --- | --- | | benchmark | object | The benchmark object. | | browser | object | Browser data. | | config | object | The config object. |

karmaBenchConfig([settings]) ⇒ function

Returns a config function that can be used with karma-benchmark. Sets up karma-benchmark to run in Chrome headless with karma-benchmarkjs-reporter (with the local formatBenchmark formatter), and webpack in production mode. Looks for files in a bench directory that match **/*.bench.js.

| Param | Type | Description | | --- | --- | --- | | [settings] | object | Overrides any of the provided settings. |

Example
create a file in the root of your project called karma.bench.conf.js:

const {karmaBenchConfig} = require('karma-webpack-bundle');

module.exports = karmaBenchConfig();

and add a script to package.json:

    "bench": "karma start karma.bench.conf.js"

then run it:

npm run bench

karmaConfig([testRunnerConfig], [settings]) ⇒ function

Returns a config function that can be used with karma. Sets up karma to run in Chrome headless and Firefox headless with mocha and karma-mocha-reporter.

If --single-run is provided then webpack runs in production mode, otherwise it runs in dev mode.

If running on Travis CI then karma-coverage and karma-coveralls are added to reporters

By default it Looks for test files in a tests directory that match *.test.js. For source files it looks for index.js, and *.js files in a src directory or lib directory.

| Param | Type | Description | | --- | --- | --- | | [testRunnerConfig] | Array | A valid config for test-runner-config. | | [settings] | object | Overrides any of the provided settings. |

Example
Create a file in the root of your project called karma.conf.js:

const { karmaConfig } = require('karma-webpack-bundle');

module.exports = karmaConfig();

and add a script or two to package.json:

    "test": "karma start --single-run",
    "test-watch": "karma start",

then run it:

npm test

wallabyConfig([testRunnerConfig], [settings]) ⇒ function

Returns a config function that can be used with wallaby. Sets the test framework to mocha, runs in Chrome headless, and sets up webpack similar to the karma config.

By default it Looks for test files in a tests directory that match *.test.js. For source files it looks for index.js, and *.js files in a src directory or lib directory.

| Param | Type | Description | | --- | --- | --- | | [testRunnerConfig] | Array | A valid config for test-runner-config. | | [settings] | object | Overrides any of the provided settings. |

Example
create a file in the root of your project called wallaby.conf.js:

const { wallabyConfig } = require('karma-webpack-bundle');

module.exports = wallabyConfig();