# karma-base64-to-js-preprocessor

> A Karma plugin. Convert base64-encoded files into JavaScript strings to serve them in a script tag.

Latest version **0.1.0** (published 2021-08-30) · MIT license · 0 weekly downloads

## Install

```sh
npm install karma-base64-to-js-preprocessor
pnpm add karma-base64-to-js-preprocessor
yarn add karma-base64-to-js-preprocessor
bun add karma-base64-to-js-preprocessor
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2021-08-30 |
| First published | 2021-08-30 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 3 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Author | PhonicScore GmbH |
| Maintainers | sschmidtu |

## Links

- npm: https://www.npmjs.com/package/karma-base64-to-js-preprocessor
- Repository: https://github.com/opensheetmusicdisplay/karma-base64-to-js-preprocessor
- Homepage: https://github.com/opensheetmusicdisplay/karma-base64-to-js-preprocessor#readme
- Issues: https://github.com/opensheetmusicdisplay/karma-base64-to-js-preprocessor/issues
- npm.io page: https://npm.io/package/karma-base64-to-js-preprocessor

## Recent versions

- 0.1.0 (latest) — 2021-08-30
- 0.0.2 — 2021-08-30

## README

# karma-base64-to-js-preprocessor

Preprocessor for converting base64-encoded files into JavaScript strings.

## Installation

Just run:
```bash
npm install karma-base64-to-js-preprocessor --save-dev
```

## Configuration
This is the default configuration:
```js
// karma.conf.js
module.exports = function(config) {
  config.set({
    preprocessors: {
      '**/*.exe.base64': ['base64-to-js']
    },
    files: [
      '**/*.exe.base64',
      '*.js'
    ]
  });
};
```

## How does it work ?

This preprocessor converts base64-encoded files into JS strings and publishes them in the global `window.__raw__`.

For instance the file `test.base64`:
```
VGhpcyBpcyBhIHRlc3QuCg==
```
will be served as `test.base64.js`:
```js
window.__raw__ = window.__raw__ || {};
window.__raw__['test'] = "This is a test.";
```

---
_Source: https://npm.io/package/karma-base64-to-js-preprocessor · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
