Skip to content

bendrucker/simple-format

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

simple-format Build Status Greenkeeper badge

Simple util.format replace that handles multiple arguments

Install

$ npm install --save simple-format

Usage

var format = require('simple-format')
format('unicorns', '&', 'rainbows')
//=> unicorns & rainbows
format('%s & %s', 'unicorns', 'rainbows')
//=> unicorns & rainbows

API

format(messages...) -> string

messages

Type: string (variadic)

Strings to format. Operates like util.format which powers console.log in Node. If the first message has replacement tokens (e.g. %s), later arguments will be used as replacements. Otherwise, all arguments will be joined with a space.

License

MIT © Ben Drucker

About

Simple util.format replace that handles multiple arguments

Resources

License

Stars

Watchers

Forks

Packages

No packages published