JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 112430
  • Score
    100M100P100Q150818F

Basic template helpers for printing messages out to the console. Useful for debugging context in templates. Should work with any template engine.

Package Exports

  • logging-helpers

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

Readme

logging-helpers NPM version

Basic template helpers for printing messages out to the console. Useful for debugging context in templates. Should work with any template engine.

Install

Install with npm

npm i logging-helpers --save

Run tests

npm test

Register the helper

This should work with any engine, here are a few examples

template

template.helpers('logging-helpers', require('logging-helpers'));

assemble

assemble.helpers('logging-helpers', require('logging-helpers'));

verb

verb.helpers('logging-helpers', require('logging-helpers'));

handlebars

var handlebars = require('handlebars');
handlebars.registerHelper('logging-helpers', require('logging-helpers'));

Example usage

Handlebars:

{{log "%s" "this is a message"}}
{{info "%s" "this is a message"}}
{{bold "%s" "this is a message"}}
{{warn "%s" "this is a message"}}
{{error "%s" "this is a message"}}

Lo-Dash or Underscore:

<%%= log("%s", "this is a message") %>
<%%= info("%s", "this is a message") %>
<%%= bold("%s", "this is a message") %>
<%%= warn("%s", "this is a message") %>
<%%= error("%s", "this is a message") %>

Verb (lo-dash, with special delimiters to avoid delimiter collision in documentation):

{%= log("%s", "this is a message") %}
{%= info("%s", "this is a message") %}
{%= bold("%s", "this is a message") %}
{%= warn("%s", "this is a message") %}
{%= error("%s", "this is a message") %}

Contributing

Pull requests and stars are always welcome. For bugs and feature requests, please create an issue

Author

Jon Schlinkert

License

Copyright (c) 2014 Jon Schlinkert
Released under the MIT license


This file was generated by verb on November 11, 2014.