https://github.com/tpkn/shrink-string
Cut the string to bla-bla-bla...
https://github.com/tpkn/shrink-string
Last synced: 3 months ago
JSON representation
Cut the string to bla-bla-bla...
- Host: GitHub
- URL: https://github.com/tpkn/shrink-string
- Owner: tpkn
- License: mit
- Created: 2019-04-10T17:54:07.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-04-10T18:00:50.000Z (about 6 years ago)
- Last Synced: 2025-01-14T08:12:52.485Z (4 months ago)
- Language: JavaScript
- Size: 1.95 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Shrink String
Cut the string to bla-bla-bla...## API
```javascript
String.shrink([len, between])
```### len
**Type**: _Number_
**Default**: `32`
Cut to this length### between
**Type**: _String_
**Default**: `..`
This line will be added between the two halves of the text (adds to the length of the final result!)## Usage
```javascript
'https://github.com'.shrink();
// => https://github.com'https://developer.mozilla.org/en-US/'.shrink(18, ' - ');
// => https:/ - /en-US/
```