Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

cl-strings

Package Overview
Dependencies
Maintainers
1
Versions
4
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

cl-strings

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

  • 0.0.5
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

#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));

Keywords

FAQs

Package last updated on 18 Feb 2014

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc