Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/marcuswhybrow/strfix

prefix & suffix strings simply
https://github.com/marcuswhybrow/strfix

Last synced: 27 days ago
JSON representation

prefix & suffix strings simply

Awesome Lists containing this project

README

        

Affix strings, arrays and objects, with prefixes and suffixes:

`npm install strfix`

Usage:

```node
const strfix = require('strfix');

strfix('input', {prefix: 'pre-', suffix: '-post'});
// pre-input-post

strfix(['input1', 'input2'], {prefix: 'pre-', suffix: '-post'});
// [ 'pre-input1-post', 'pre-input2-post' ]

strfix({key1: 'val1', key2: 'val2'}, {prefix: 'pre-', suffix: '-post'});
// { key1: 'pre-val1-post', key2: 'pre-val2-post' }
```