Converts the selected JS lines to string (single-line/concatenated).
Concatenated
Single-line
- Via apm
apm install js-to-string
- From Atom
Settings
>Install
> Search packages forjs-to-string
.- Click
Install
and thenreload
Atom.
- From GitHub
- Download the latest release and extract the archive directly to
/users/YOUR_USERNAME/.atom/packages
. - Run
npm install
.
- Download the latest release and extract the archive directly to
- Make a selection.
- Then do one of the following:
- Press
Ctrl + Alt + Shift + S
on Windows orCmd + Alt + Shift + S
on Mac. - Right click and choose
JS to string
. - From Atom's menu:
Packages
>JS to string
>Convert
.
- Press
- Auto-complete selections:
- the selection will be updated automatically so that the start and end lines are completely selected.
- JS beautifier:
- the selected lines can be beautified before they're stringified.
- String:
Style
: Choose between single-line or concatenated. Default:concatenated
.Quotes
: Use single or double quotes to wrap the string. Default:single
.Strip comments
: Generate the string without the commented-out lines. Default:false
.Include whitespaces
: If this is unchecked, any tabs or new line characters will be stripped. Default:true
.Add trailing character
: Insert a custom character after the quotes. Default:true
.Trailing character
: The character that will be inserted at the end of the string, after the quotes. Default:;
.
- JS Beautifier:
Beautify
: The selected code will be first beautified before it's stringified. Default:true
.Indent size
: Number of spaces used to represent a tab. Default:2
.