@prpl/core
TypeScript icon, indicating that this package has built-in type declarations

0.4.0 • Public • Published

@prpl/core

This module interpolates your content into HTML.

Usage

Can be used via the prpl CLI command, or in CJS/ESM. Example in ESM:

import { interpolate } from '@prpl/core';

// Default options
const options = {
  noClientJS: false,
  templateRegex: (key) => new RegExp(`\\[${key}\\]`, 'g'),
  markedOptions: {}
};

async function build() {
  await interpolate({ options });
}

build();

Dependencies

@prpl/core has one dependency: marked, a markdown compiler. Reasons for relying on it include:

  • It is not practical to implement a markdown compiler within the PRPL library
  • It is fair to assume that most users will author content in markdown given its ubiquity
  • marked itself has zero dependencies and is actively maintained

In the future it may make sense to externalize this dependency, but given the above reasons it is included for now.

Package Sidebar

Install

npm i @prpl/core

Weekly Downloads

0

Version

0.4.0

License

MIT

Unpacked Size

58.4 kB

Total Files

30

Last publish

Collaborators

  • tyhopp