cl-strings
> String template system for multi-colour console output with interpolation.
Last updated 12 years ago by shakyshane .
MIT · Repository · Bugs · Original npm · Tarball · package.json
$ cnpm install cl-strings 
SYNC missed versions from official npm registry.

#cl-strings Build Status

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

Basically a wrapper around chalk & lodash templates

npm install cl-strings

##Load as dependency in your project

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

##Usage examples

var compile = require("./index").compile;
var compileWithPrexfix = require("./index").getCompiler("[PREFIX]");

var string;
var multiLine;

// Single line, single colour
var singleLine = "{green:This is a green string}";
console.log(compile(singleLine));

// Single Line, multi colour
var multiColor = "{green:This is a green string} with a {red:red string} inside";
console.log(compile(multiColor));

// With prefix & Multiline
var prefixed = [];
prefixed.push("This is line 1");
prefixed.push("This is line 2");
console.log(compileWithPrexfix(prefixed));

// With prefix, multiline & colors
prefixed = [];
prefixed.push("{green:This is line 1 in GREEN}");
prefixed.push("This is line 2 with no colour");
prefixed.push("{red:This is line 3 in RED}");
console.log(compileWithPrexfix(prefixed));

Current Tags

  • 0.0.5                                ...           latest (12 years ago)

4 Versions

  • 0.0.5                                ...           12 years ago
  • 0.0.4                                ...           12 years ago
  • 0.0.3                                ...           12 years ago
  • 0.0.2                                ...           12 years ago
Maintainers (1)
Downloads
Today 0
This Week 0
This Month 0
Last Day 0
Last Week 0
Last Month 1
Dependencies (2)
Dev Dependencies (4)
Dependents (1)

Copyright 2013 - present © cnpmjs.org | Home |