Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

🎨 colourful sprintf

License

NotificationsYou must be signed in to change notification settings

sdgluck/carbonate

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🎨 colourful sprintf

Made with ❤ at@outlandish

npm versionjs-standard-style

sprintf('I do not like %s(green) and ham.','green eggs')sprintf('I do not like them, %s(yellow.bold.underline).','Sam-I-am')

🍪 Give some colour to your sprintf strings withchalk.

✨ Written for ES2015 environments.

👉 Use your preferred bundler and transpiler as required.

Install

npm install --save carbonate
yarn add carbonate

Import

// ES2015importsprintffrom'carbonate'
// CommonJSvarsprintf=require('carbonate')

Usage

sprintf(str[, ...values]) : String

Format a string with values.

  • str {String} The string to format
  • [values] {Any} Values to interpolate

Returns a string.

Examples:

// simple coloursprintf('I do not like %s(green) and ham.','green eggs')// use chalk's chaining for bold, etc.sprintf('I do not like them, %s(yellow.bold.underline).','Sam-I-am')

sprintf.log(str[, ...values])

Format and console.log a string.

  • str {String} The string to format
  • [values] {Any} Values to interpolate

Type specifiers

All specifiers insprintf.js are available.

Contributing

All pull requests and issues welcome!

If you're not sure how, check out thegreat video tutorials on egghead.io!

License

MIT ©Sam Gluck

Releases

No releases published

Packages

No packages published

[8]ページ先頭

©2009-2025 Movatter.jp