Socket
Socket
Sign inDemoInstall

liquidless

Package Overview
Dependencies
Maintainers
1
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

liquidless

Shopify's Liquid template engine, but less powerful


Version published
Weekly downloads
3.2K
decreased by-6.72%
Maintainers
1
Weekly downloads
 
Created
Source

liquidless

Shopify's Liquid template engine, but less powerful. Perfect for configuration files

Get Started

Install the dependency from npm:

npm i liquidless

Import the renderString function

import { renderString } from 'liquidless'

Usage

Example: Rendering a string

renderString('Hello, {{ world }}', { world: 'world!' })

Outputs:

Hello, world!

Example: Using filters

renderString('Hello, {{ world | upcase }}', { world: 'world!' })

Outputs:

Hello, WORLD!

Example: Supplying custom filters

renderString('Hello, {{ world | something: 1, 2, 3 }}', { world: 'world!' }, {
  filters: {
    something: (value, args, variable) => `${value} ${args.join(', ')} (${variable})`
  }
})

Outputs:

Hello, world 1, 2, 3 (world)!

Example: Rending values in an object

import { renderObject } from 'liquidless'
renderObject([{hello: {world: '{{ world }}'}}], { world: 'world!' })

Outputs

[{hello: {world: 'world!'}}]

Filters

  • upcase - converts each character of a string to uppercase

Keywords

FAQs

Package last updated on 24 May 2023

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