Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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: 6 days 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 (over 7 years ago)
- Default Branch: master
- Last Pushed: 2024-10-22T05:20:09.000Z (24 days ago)
- Last Synced: 2024-10-23T07:40:05.068Z (23 days ago)
- Topics: string-manipulation
- Language: TypeScript
- Homepage:
- Size: 1010 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# singleline
![Build status](https://api.travis-ci.org/benbowes/singleline.svg?branch=master)
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
'```