• Packages
  • Themes
  • Documentation
  • Blog
  • Discuss
Sign in

js-to-string

Converts the selected JS lines to string (single-line/concatenated).
  • #js
  • #jsx
  • #jsxbin
  • #javascript
  • #extendscript
alexmunteanu
1.0.5 493
1
  • Repo
  • Bugs
  • Versions
  • License
Flag as spam or malicious

JS to string (Atom package)

Converts the selected JS lines to string (single-line/concatenated).

Concatenated

js-to-string demo convert concatenated

Single-line

js-to-string demo convert single-line

Installation

  • Via apm
apm install js-to-string
  • From Atom
    • Settings > Install > Search packages for js-to-string.
    • Click Install and then reload Atom.
  • From GitHub
    • Download the latest release and extract the archive directly to /users/YOUR_USERNAME/.atom/packages.
    • Run npm install.

Usage

  • Make a selection.
  • Then do one of the following:
    • Press Ctrl + Alt + Shift + S on Windows or Cmd + Alt + Shift + S on Mac.
    • Right click and choose JS to string.
    • From Atom's menu: Packages > JS to string > Convert.

Features

  • 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.

Options

  • 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.

Buy me a beer

Donate

I think this package is bad news.

Good catch. Let us know what about this package looks wrong to you, and we'll investigate right away.

  • Terms of Use
  • Privacy
  • Code of Conduct
  • Releases
  • FAQ
  • Contact
with by