Caret Plugin::Pretty-JavaScript

Extension Delisted

This extension is no longer available in the official store. Delisted on 2025-09-16.

CRX ID
nfkohdggkammeogcdpmiebnlbcgpdcii
Description from extension meta

This plugin will format JavaScript in Caret Editor.

Description from store

A Caret Editor plug-in which allows for Pretty Print for JavaScript.

If you find any issues with the plug-in please open an issue at the GitHub page.

Note:

You will need to configure Caret to see the plugin as it will not automatically. The following will help you configure Caret

api.json

You'll need to add the following to your api.json file, under settings menu. This plugin can pass the same options that JS-Beautify does in the 'options' tag. I left the default 'sampleMessage' in there for the example. Note: the options in Pretty-JavaScript, these can be any of the options from JS Beautifier https://github.com/beautify-web/js-beautify as this plug-in uses it and is just a wrapper for it to work in Caret.

{
"sampleMessage": {
"id": "extension id goes here",
"message": {
"data": "message can be any JSON object passable to chrome.runtime.sendMessageExternal"
}
},
"Pretty-JavaScript": {
"id": "nfkohdggkammeogcdpmiebnlbcgpdcii",
"message": {
"options": {
"indent_size": 1,
"indent_char": "\t",
"max_preserve_newlines": 2,
"brace_style": "collapse",
"jslint_happy": true,
"wrap_line_length": 0
}
},
"sendEditorContext": true
}
}
key.json

You'll want to bind the command to the keyboard, you can select any shortcut combo that you want.

"Ctrl-Shift-H": {
"command": "api:execute",
"argument": "Pretty-JavaScript"
}
menus.json

This is optional, but allows the command to be accessible in menu system.

{
"label": "JavaScript Beautify",
"command": "api:execute",
"argument": "Pretty-JavaScript"
}

The following have contributed works

Without the following, this plug-in would not exist. Thanks to their works.

Caret :: https://github.com/thomaswilburn/Caret

JS-Beautify :: https://github.com/beautify-web/js-beautify

Latest reviews

Rico Trevisan 2020-09-24

Excellent! (it might be worthwhile to add a picture to the plugin with the instructions or an arrow pointing down to how to install it. I lost waaaay too much time not rtfm...)

Kevin Griffin 2018-07-01

This is a nice extension to Caret.

LotsOfBitts 2018-05-05

I can't get it to work, no matter how hard I try

Anthony Bakopoulos 2018-01-26

how do you make a game? and why does it not look the same as on youtube!?

Tom Proffitt 2017-09-27

It's good for html

Statistics

Installs
533
Market
Chrome Web Store
Category
11_web_development
Rating
4.2 (5 votes)
Last update
2019-03-08
Version 1.0.1
Languages
en-US