- Notifications
You must be signed in to change notification settings - Fork2
sdgluck/carbonate
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
🎨 colourful sprintf
Made with ❤ at@outlandish
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.
npm install --save carbonate
yarn add carbonate
// ES2015importsprintffrom'carbonate'
// CommonJSvarsprintf=require('carbonate')
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')
Format and console.log a string.
- str {String} The string to format
- [values] {Any} Values to interpolate
All specifiers insprintf.js
are available.
All pull requests and issues welcome!
If you're not sure how, check out thegreat video tutorials on egghead.io!
MIT ©Sam Gluck