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

sjablong

Package Overview
Dependencies
Maintainers
1
Versions
33
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

sjablong

A system for replacing and/or validating replacement-fields in text

  • 1.0.33
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
5
increased by25%
Maintainers
1
Weekly downloads
 
Created
Source

Sjablong

Templating engine with the combined powers of handlebars, front-matter, JSON Schema and Sjablong-fields

What can Sjablong do?

  • Replace placeholders in text (Sjablong-fields, mustache or handlebars-expressions)
  • Generate JSON Schema from Sjablong-fields and validate data against it
  • Have default values for the template by front-matter or Sjablong-fields
  • Convert Markup to HTML

Sjablong-fields

A Sjablong-field starts with [[ and ends with ]]
Inbetween the tags you define keyvalue-pair in the format key="value"
The only required key in a Sjablong-field is path. This it path in the data it should be replaced with. The Sjablong-fields can be used to generate a JSONSchema to validate the data with.

Field examples

KeyDescriptionRequiredExample
labelName/title of the fieldNoFornavn
pathThe path in the data object it should be replaced withYesname.firstname
descriptionDescription of the fieldNoFirstname of the recipient
requiredShould the field be required?Notrue
defaultThe default value of the fieldNoBjarne
previewIf replacePlacehold's preview option is trueNoBjarne

Examples

Sjablong-felt on a single line

[[label="fornavn":path="name.firstname"]]

Sjablong-felt with multiline default value

[[label="test":path="test":default="Line1\nLine2\nLine3"]]

Sjablong-felt on multiple lines (It is not necessary to indent the pairs)

[[
  label="fornavn"
  path="name.firstname"
]]

Sjablong-felt on multiple lines with more fields

[[
  label="fornavn"
  path="name.firstname"
  descriptione="First name of the recipient"
  required="true"
  default="Max"
  preview="Bjarne"
]]

FAQs

Package last updated on 13 Jan 2022

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