Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
###If you like plates, you will love dishwasher.
This nice little plates add-on module suddenly evolved from fairy droppings. Now, it's a full-blown dishwasher washing your plates (obviously, you need to fill it with objects).
Read your templates folder:
dishwasher.setFolder(folderwithyourtemplates, [cwd])
Rinse your plates:
dishwasher.rinse(pageobject, arrayofobjects, mapsobject)
The mapsobject holds five plates mapping instances (the must be called pagemap, singelmap, multimap, fragments and collections)
The pageobject
can hold several optional data keys. At least it must have
two keys: mastertemplate and pagemultiset.
mastertemplate
is the name of the template which plates should use to renderd
the page.
pagemultiset
is an array of strings. dishwasher will search every object in
the arrayofobjects
argument with which rinse()
was called. If one or more
objects with the corresponding string are found they are considered a
collection.
Collections will always be renderd with a template of the same name from the
template folder.
arrayofobjects
holds all the data you want to insert into the mastertemplate.
Each object should tell dishwasher via a collection
key, which collections it
belongs to. If the object does not belong to a collection, it should tell
dishwasher like so object.collection = 'none'
.
pagemap
is a plates.Map()
which tells dishwasher where and how the keys from
pageobject
should be replaced/inserted.
singlemap
and multimap
will be used to append additional template partials
within your mastertemplate (this is useful if you want to render several
collections or lots of fragments and want to keep templates and partials
reusable).
fragments
and collections
do the same for objects with no collection and
collections in arrayofobjects
.
If there are still a lot of question marks popping above your head have a look at the tests.
ENJOY!
FAQs
Renders an array of objects with plates templates
The npm package dishwasher receives a total of 13 weekly downloads. As such, dishwasher popularity was classified as not popular.
We found that dishwasher demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.