New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ibra

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

ibra

Use markdown as an html templating engine.

  • 1.0.3
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Ibra Build Status

Install

  npm i ibra --save

Ibra is a performant templating engine for javascript that uses markdown syntax to define structure. Lodash style templates can be used to process logic in your markdown files. Essentially, mix markdown syntax and lodash templating for rendering HTML.

For information on using lodash templates visit the lodash documentation

Usage

Use @{ and @} for defining blocks that should be evaluated as lodash templates.

const text = `# @{
                <%=name %>
              @}

              @{
                <ul>
                <% for (var i = 1; i <= 10; i++) { %>
                  <li><%=i%></li>
                <% } %>
                </ul>
              @}`

const data = {name: 'tom'}
const ibra = require('ibra')
const html = ibra(content, data)

/* 
  html becomes: 
  
  <h1>tom</h1>
  <ul>
    <li>1</li>
    <li>2</li>
    <li>3</li>
    ...
  </ul>'
*/

Contributing

Fork this repository and run npm install in project directory.

Tests

npm run test

Keywords

FAQs

Package last updated on 26 Mar 2017

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