Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/dustinspecker/string-surround
Surround a string with another string
https://github.com/dustinspecker/string-surround
Last synced: 2 days ago
JSON representation
Surround a string with another string
- Host: GitHub
- URL: https://github.com/dustinspecker/string-surround
- Owner: dustinspecker
- License: mit
- Created: 2016-04-07T21:52:27.000Z (over 8 years ago)
- Default Branch: master
- Last Pushed: 2016-04-08T11:00:44.000Z (over 8 years ago)
- Last Synced: 2024-08-09T10:28:19.623Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 5.86 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
- License: license.md
Awesome Lists containing this project
README
# string-surround
[![NPM version](https://badge.fury.io/js/string-surround.svg)](https://badge.fury.io/js/string-surround) [![Build Status](https://travis-ci.org/dustinspecker/string-surround.svg)](https://travis-ci.org/dustinspecker/string-surround) [![Coverage Status](https://img.shields.io/coveralls/dustinspecker/string-surround.svg)](https://coveralls.io/r/dustinspecker/string-surround?branch=master)[![Code Climate](https://codeclimate.com/github/dustinspecker/string-surround/badges/gpa.svg)](https://codeclimate.com/github/dustinspecker/string-surround) [![Dependencies](https://david-dm.org/dustinspecker/string-surround.svg)](https://david-dm.org/dustinspecker/string-surround/#info=dependencies&view=table) [![DevDependencies](https://david-dm.org/dustinspecker/string-surround/dev-status.svg)](https://david-dm.org/dustinspecker/string-surround/#info=devDependencies&view=table)
> Surround a string with another string
## Install
```
npm install --save string-surround
```## Usage
```javascript
import stringSurround from 'string-surround'stringSurround('hello', '123')
// => '123hello123'stringSurround('', 'ABC')
// => 'ABCABC'
```## API
### stringSurround(string, [surroundingString])
Returns `string` surrounded with `surroundingString`.
#### string
type: `string`The string to surround.
#### surroundingString
type: `string`default: `''`
The string to surround around `string`.
## LICENSE
MIT © [Dustin Specker](https://github.com/dustinspecker)