<commit_before>[![npm](https://nodei.co/npm/v8-print-code-highlighter.png)](https://nodei.co/npm/v8-print-code-highlighter/)

# v8-print-code-highlighter

[![Dependency Status][david-badge]][david]

Dual syntax highlighter for `--print-code` / `--print-opt-code` [V8][v8] dumps. Highlights source sections as JavaScript and code sections as ASM.

[v8]: https://code.google.com/p/v8-wiki/

[david]: https://david-dm.org/eush77/v8-print-code-highlighter
[david-badge]: https://david-dm.org/eush77/v8-print-code-highlighter.png

## Example

```
$ d8 --print-code samples/source.js |v8-print-code-highlighter |bcat
```

Be forewarned though, those logs can be huge. You can use [v8-print-code-filter][v8-print-code-filter] for that, and let's also say you like solarized theme very much.

```
$ d8 --print-code samples/source.js |v8-print-code-filter --name exports.inherits |v8-print-code-highlighter -t solarized_dark |bcat
```

## CLI

```
Usage:  v8-print-code-highlighter [[--theme | -t] theme] [file]
        v8-print-code-highlighter --list-themes
```

Reads standard input by default, you can pass filename to make it read from file.

Spits out highlighted HTML. Use [bcat][bcat] or something similar to redirect the output to a browser tab, or just save to file and open manually.

[bcat]: http://rtomayko.github.io/bcat/

## TODO

- Add ANSI output format (for the terminal).
<commit_msg>(readme) Add themes section<commit_after>[![npm](https://nodei.co/npm/v8-print-code-highlighter.png)](https://nodei.co/npm/v8-print-code-highlighter/)

# v8-print-code-highlighter

[![Dependency Status][david-badge]][david]

Dual syntax highlighter for `--print-code` / `--print-opt-code` [V8][v8] dumps. Highlights source sections as JavaScript and code sections as ASM.

[v8]: https://code.google.com/p/v8-wiki/

[david]: https://david-dm.org/eush77/v8-print-code-highlighter
[david-badge]: https://david-dm.org/eush77/v8-print-code-highlighter.png

## Example

```
$ d8 --print-code samples/source.js |v8-print-code-highlighter |bcat
```

Be forewarned though, those logs can be huge. You can use [v8-print-code-filter][v8-print-code-filter] for that, and let's also say you like solarized theme very much.

```
$ d8 --print-code samples/source.js |v8-print-code-filter --name exports.inherits |v8-print-code-highlighter -t solarized_dark |bcat
```

## CLI

```
Usage:  v8-print-code-highlighter [[--theme | -t] theme] [file]
        v8-print-code-highlighter --list-themes
```

Reads standard input by default, you can pass filename to make it read from file.

Spits out highlighted HTML. Use [bcat][bcat] or something similar to redirect the output to a browser tab, or just save to file and open manually.

[bcat]: http://rtomayko.github.io/bcat/

## Themes

All the themes come from [highlight.js][hljs] project. Check out its [demo page][demo] for comparison.

[hljs]: https://highlightjs.org/
[demo]: https://highlightjs.org/static/demo/

## TODO

- Add ANSI output format (for the terminal).

{'fraction_non_alphanumeric': 0.15520694259012016, 'fraction_numerical': 0.014686248331108143, 'mean_word_length': 3.978405315614618, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 12, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '1128521', 'n_tokens_mistral': 1103, 'n_tokens_neox': 1065, 'n_words': 276}