Crates.io | prettify-js |
lib.rs | prettify-js |
version | 0.1.0 |
source | src |
created_at | 2020-07-17 05:53:07.153843 |
updated_at | 2020-07-17 05:53:07.153843 |
description | A fast, robust but imperfect token-based JS code prettifier, written in Rust, that outputs JS source maps |
homepage | |
repository | https://github.com/Pernosco/prettify-js |
max_upload_size | |
id | 266132 |
size | 36,883 |
A fast, robust but imperfect token-based JS code prettifier, written in Rust, that outputs JS source maps.
The code was mostly ported from Mozilla's pretty-fast. Instead of using Acorn to tokenize, we use RESS. Instead of using the source-map package to generate source maps, we use our own very minimal handwritten source-map emitter. The original pretty-fast code tries to avoid emitting more than one source-map record per pretty line; instead we emit one source-map record per token, because we sometimes care about code offsets within a pretty line.