# liquidless

> Shopify's Liquid template engine, but less powerful

Latest version **1.3.4** (published 2024-06-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install liquidless
pnpm add liquidless
yarn add liquidless
bun add liquidless
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.3.4 |
| Published | 2024-06-05 |
| First published | 2022-10-18 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 2 |
| Unpacked size | 13 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 11 |
| Author | Mish Ushakov |
| Maintainers | mishushakov |
| Keywords | liquid, shopify, template |

## Links

- npm: https://www.npmjs.com/package/liquidless
- Repository: https://github.com/stepci/liquidless
- Homepage: https://github.com/stepci
- Issues: https://github.com/stepci/liquidless/issues
- npm.io page: https://npm.io/package/liquidless

## Dependencies (2)

- [flat](https://npm.io/package/flat.md) ^5.0.2
- [json5](https://npm.io/package/json5.md) ^2.2.3

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 1.3.4 (latest) — 2024-06-05
- 1.3.3 — 2024-05-12
- 1.3.2 — 2024-02-23
- 1.3.1 — 2024-02-23
- 1.3.0 — 2024-01-12
- 1.2.3 — 2023-06-12
- 1.2.2 — 2023-06-12
- 1.2.1 — 2023-05-24
- 1.2.0 — 2022-11-26
- 1.1.0 — 2022-11-17
- 1.0.9 — 2022-11-02
- 1.0.8 — 2022-10-20
- 1.0.7 — 2022-10-20
- 1.0.6 — 2022-10-20
- 1.0.5 — 2022-10-19
- … 2 more at https://npm.io/package/liquidless/versions

## README

# liquidless

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

## Get Started

Install the dependency from npm:

```sh
npm i liquidless
```

Import the `renderString` function

```js
import { renderString } from 'liquidless'
```

## Usage

**Example: Rendering a string**

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

Outputs:

```
Hello, world!
```

**Example: Using filters**

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

Outputs:

```
Hello, WORLD!
```

**Example: Supplying custom filters**

```js
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**

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

Outputs

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

## Filters

- `append` - Adds a given string to the end of a string.
- `base64_decode` - Decodes a string in Base64 format.
- `base64_encode` - Encodes a string to Base64 format.
- `camelize` - Converts a string to CamelCase.
- `capitalize` - Capitalizes the first word in a string and downcases the remaining characters.
- `downcase` - Converts a string to all lowercase characters.
- `escape` - Escapes special characters in HTML, such as `<>`, ', and `&`, and converts characters into escape sequences.
- `hmac_sha1` - Converts a string into an SHA-1 hash using a hash message authentication code (HMAC).
- `hmac_sha256` - Converts a string into an SHA-256 hash using a hash message authentication code (HMAC).
- `lstrip` - Strips all whitespace from the left of a string.
- `md5` - Converts a string into an MD5 hash.
- `newline_to_br` - Converts newlines (`\n`) in a string to HTML line breaks (`<br>`).
- `pluralize` - Outputs the singular or plural version of a string based on a given number.
- `prepend` - Adds a given string to the beginning of a string.
- `remove` - Removes any instance of a substring inside a string.
- `remove_first` - Removes the first instance of a substring inside a string.
- `remove_last` - Removes the last instance of a substring inside a string.
- `replace` - Replaces any instance of a substring inside a string with a given string.
- `replace_first` - Replaces the first instance of a substring inside a string with a given string.
- `replace_last` - Replaces the last instance of a substring inside a string with a given string.
- `rstrip` - Strips all whitespace from the right of a string.
- `sha1` - Converts a string into an SHA-1 hash using a hash message authentication code (HMAC).
- `sha256` - Converts a string into an SHA-256 hash using a hash message authentication code (HMAC).
- `slice` - Returns a substring or series of array items, starting at a given 0-based index.
- `split` - Splits a string into an array of substrings based on a given separator.
- `strip` - Strips all whitespace from the left and right of a string.
- `strip_html` - Strips all HTML tags from a string.
- `strip_newlines` - Strips all newline characters (line breaks) from a string.
- `toInt` - Converts a value to Int
- `toFloat` - Converts a value to Float
- `toString` - Converts a value to String
- `upcase` - Converts a string to all uppercase characters.
- `url_decode` - Decodes a string to URL-safe format by converting percent-encoded characters to special characters.
- `url_encode` - Encodes a string to URL-safe format by converting special characters to percent-encoded characters.

---
_Source: https://npm.io/package/liquidless · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
