Important: This documentation covers Yarn 1 (Classic).
For Yarn 2+ docs and migration guide, see yarnpkg.com.

Package detail

format-unicorn

tallesl94.2kFairdeprecated1.1.1TypeScript support: definitely-typed

Package no longer supported. Contact Support at https://www.npmjs.com/support for more info.

Stack Exchange's string format function.

string, format, formatunicorn, stackexchange

readme

: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.'