Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

jsplate

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

jsplate

Javascript templating engine, preprocessing js in markdown files

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

jsplate pre-processes javascript in Markdown files. It interprets code in js code blocks and inline variables and renders directly into md. Such as this:


This is a Markdown file

```js
  x = "This used to be a js code block";
  y = "nice";
  name = process.argv[2];

  return x
```

Have a ${y} day ${name}!

Ran using jsplate template.md "Madam", will render:


This is a Markdown file

This used to be a js code block

Have a nice day Madam!

Additional details:

  • If you want to re-use variables between code blocks, be sure to declare them as global (not using const).
  • If you are allergic to global variables jsplate is also declaring a global object that you can enrich, for example using global.x = "some value"
  • Blocks are evaluated in an async context, you can use await!

Keywords

FAQs

Package last updated on 09 Mar 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