1.1.1 • Published 7 years ago

format-unicorn v1.1.1

Weekly downloads
143,413
License
Fair
Repository
github
Last release
7 years ago

:rainbow: Format Unicorn

A string format function made and used by Stack Exchange on their various websites. * *

Usage

$ npm install format-unicorn
(...)
$ node
> require('format-unicorn') // this adds formatUnicorn to String.prototype
{}
> 'We are not in {place} anymore.'.formatUnicorn({ place: 'Kansas' })
'We are not in Kansas anymore.'
> let formatUnicorn = require('format-unicorn/safe') // 'safer' version if you don't wanna mess with String's prototype
undefined
> formatUnicorn('We are not in {place} anymore.', { place: 'Kansas' })
'We are not in Kansas anymore.'