https://github.com/benbowes/singleline
Convert a multiline string into a single line string, concatenate class-names, minimize html
https://github.com/benbowes/singleline
string-manipulation
Last synced: 2 months ago
JSON representation
Convert a multiline string into a single line string, concatenate class-names, minimize html
- Host: GitHub
- URL: https://github.com/benbowes/singleline
- Owner: benbowes
- License: mit
- Created: 2017-06-24T15:20:44.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2024-11-13T11:06:47.000Z (8 months ago)
- Last Synced: 2025-04-15T13:27:41.459Z (3 months ago)
- Topics: string-manipulation
- Language: TypeScript
- Homepage:
- Size: 2 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# singleline

Convert a multiline string to a single line string
---## Getting started
Install the dependency
`npm install singleline --save-dev`
## React classNames example
```js
import singleline from 'singleline';...
Some output// className="rrs__select-container rrs__select-container--multiselect rrs__is-desktop rrs__options-container--visible"
```## Example 2
Passing second parameter in as `true`, removes spaces around the HTML tags but it still respects the spaces in the contents of the tags and attributes.
```js
import singleline from 'singleline';
var testMultilineHTMLString = singleline(`
GDD - Giphy Github embed Gif code explorer
`, true);
console.log(testMultilineHTMLString);
// 'GDD - Giphy Github embed Gif code explorer
'```