npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

dry

v2.0.0

Published

Dry is superset of the Liquid templating language, with first-class support for advanced inheritance features, and more.

Downloads

11

Readme

dry NPM version NPM monthly downloads NPM total downloads

Dry is superset of the Liquid templating language, with first-class support for advanced inheritance features, and more.

Please consider following this project's author, Jon Schlinkert, and consider starring the project to show your :heart: and support.

Install

Install with npm (requires Node.js >=14):

$ npm install --save dry

Getting started

The simplest way to get started is with the render method, which takes a template string and a data object (the "context").

const { render } = require('dry'); // render is async
console.log(await render('Hello, {{ name }}!', { name: 'Brian' })); //=> Hello, Brian!

Using the code above, you can do almost everything you need to do with Dry.

Tags, Filters, Variables, and more!

See the docs for Shopify's Liquid to learn about all of the features in the Liquid templating language. If you can do it with Liquid, you should be able to do it with Dry. (and if you can't do it with Dry, it's a bug, and we kindly ask that you please create an issue, thanks!)

Full Documentation

Docs are on the way. In the meantime, you can use this Liquid docs to learn about all language features, and use the code snippet above to render your templates!

2.0 Notes

🎉 This release took a while. Here are some highlights!

First things first

I'm back! I know I haven't been around a lot lately, but all of that is about to change! Thank you to @doowb all of my sponsors and friends on GitHub who have provided the encouragement and support I needed to begin making this comeback.

Please consider following me and this repository to receive updates, and consider contributing to Dry so we can make this the most powerful templating library in Node.js!

Why Dry? Aren't React and Vue the future?

Yes, yes they are. Dry doesn't compete with them. We use Dry the same way Shopify and Jekyll use Liquid, many end-users don't know how to write JavaScript, and many developers would prefer not to write JavaScript - I love writing JavaScript, and I enjoy Vue and React, but there is something satisfying about deploying a site in 5 minutes using plain text html templates. We also use Dry to design and render email templates, configuration-based system messages, and so on.

What's different about Dry?

Dry is A Superset of Shopify's Liquid with first-class support for template inheritance (ahem... so you don't have to repeat yourself. So it's "dry". I know... it's all I have at the moment).

Highlights of this PR

  • Ported directly from Shopify/liquid - Wherever possible, and practical, I attempted to retain the same structure and code decisions as Shopify's Liquid. Since Ruby has a number of language features that aren't available in JavaScript, I had to find arounds or do things differently in a few places.
  • Powerful template inheritance: layouts, extends, blocks, macros, embed, imports, and even complex reassignments like {% from 'fields' import input as input_field, textarea %}
  • More than 750 unit tests so far
  • Filters: >70 filters, including all Liquid filters and more
  • Tags: >30 Tags, including all Liquid tags and a several new ones! See the list below!
  • More powerful comparisons and conditionals (more about this soon!)

Lots more!

Tags

The tags with leading + were added to Dry:

(We'll be adding more tags soon! Like section and other tags used by Shopify)

+Apply
Assign
+Block
Break
Capture
Case
Comment
+Content
Continue
Cycle
Decrement
Echo
+Embed
+Extends
For
+From
If
Ifchanged
+Import
Include
Increment
+Layout
Liquid
+Macro
+Paginate
Raw
Render
+Set
+Switch
TableRow
Unless
+Verbatim
+With

About

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

Please read the contributing guide for advice on opening issues, pull requests, and coding standards.

Running and reviewing unit tests is a great way to get familiarized with a library and its API. You can install dependencies and run tests with the following command:

$ npm install && npm test

(This project's readme.md is generated by verb, please don't edit the readme directly. Any changes to the readme must be made in the .verb.md readme template.)

To generate the readme, run the following command:

$ npm install -g verbose/verb#dev verb-generate-readme && verb

Author

Jon Schlinkert

License

Copyright © 2021, Jon Schlinkert. Released under the MIT License.


This file was generated by verb-generate-readme, v0.8.0, on July 20, 2021.