sub-in

1.0.2 • Public • Published

subIn

A tiny, fast utility function for string replacement in Javascript.

Usage

const greeting = 'Hey $0, how are you doing?'
subIn(greeting, ['Peter'])
 
// Hey Peter, how are you doing?
const friends = '$0, $1 and $2 are my friends.'
subIn(friends, ['Jake', 'Tom', 'Zack'])
 
// Jake, Tom and Zack are my friends

Readme

Keywords

none

Package Sidebar

Install

npm i sub-in

Weekly Downloads

1

Version

1.0.2

License

MIT

Last publish

Collaborators

  • peterpme