JSPM

cl-strings

0.0.2
  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 323
  • Score
    100M100P100Q80047F
  • License MIT

Package Exports

  • cl-strings

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 (cl-strings) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

#cl-strings Build Status

String template system for multi-colour console output with interpolation.

Basically a wrapper around cli-color & lodash templates

npm install cl-strings

##Load as dependency in your project

var compile = require("cl-strings").compile

##Multi colours

var string = "{green:Hi there} {red:Shane}";
console.log(compile(string));

image

##Colour in strings with interpolation

var string = "{green:Hi there {:name:}}";
var params = {
    name: "Shane"
}
console.log(compile(string, params));

image

##Partial colour with interpolation

var string = "{green:Hi there} {:name:}";
var params = {
    name: "Shane"
}
console.log(compile(string, params));

image