JSPM

format-unicorn

1.1.1
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 23624
  • Score
    100M100P100Q52169F
  • License Fair

Stack Exchange's string format function.

Package Exports

  • format-unicorn
  • format-unicorn/safe

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (format-unicorn) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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