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 🙏

© 2026 – Pkg Stats / Ryan Hefner

maren-core

v0.1.1

Published

theme based markdown renderer

Downloads

12

Readme

Maren Core

Maren is a theme based markdown renderer. It renders markdown to html by using a theme.

Theme can be developed by any tools. It is completely separated from Maren to allow easy and rich customization.

Install

npm install maren-core

API

const {
  render,
  loadTheme,
  basicTheme
} = require('maren-core');

render

/**
 * Render markdownString to html by using a theme.
 *
 * @param {string} markdownString - Markdown to render to html
 * @param {object} theme - Theme used to render Markdown
 * @param {object} theme.options
 * @param {array} theme.options.styles - Paths to css files
 * @param {array} theme.options.scripts - Paths to js files
 * @param {function} theme.beforeRender - Modify "data" to render
 * @param {function} theme.template - Template used to render html
 *
 * @return {string} Usually html, depends on template
 */
function render(markdownString, theme) { /* */ }

loadTheme

/**
 * Load theme from themeLocation.
 * Required file: themeLocation/template.js
 * Optional file: themeLocation/options.json
 *
 * @param {string} themeLocation - Absolute path to theme folder
 *
 * @return {object} Theme object { name, location, template, options }
 * @return {undefined} If theme not found
 */
function loadTheme(themeLocation) { /* */ }

basicTheme

console.log(basicTheme);
/*
{ name: 'basic',
  location: '.../maren-core/themes/basic',
  template: [Function],
  options: {} }
*/

Theme

const theme = {
  // required
  // should be compiled render function, but can be other
  template: data => data,

  // optional
  // can modify data in any way, don't forget to return new data
  beforeRender: data => {
    console.log(data);
    return data;
  },

  // optional
  // should contain minified and hashed styles and scripts
  options: {
    styles: ["styles-a8945f9ff83852c0da4d9b56dc0b50fd.css"],
    scripts: ["scripts-a73c5dd921d5f33f040f5f51890f04af.js"]
  },

  // if theme is not manually created, but loaded using loadTheme,
  // it will also have "name" and "location" like basicTheme
};

Use

Dummy theme

const { render } = require('maren-core');

/* your markdown string */
const markdown = '# Article';

/* your theme */
const theme = {
  /* required */
  template: (data) => {
    /* template can render data using
       template library of choice
       (pug, ejs, handlebars, mustache, or other)
       or simply return data as is */
    return data;
  },

  /* not required */
  options: undefined,
  beforeRender: undefined
};

/* output depends on the theme */
const output = render(markdown, theme);

console.log(output);
/*
{ meta: { title: 'Article', toc: undefined },
  html: '<h1 id="article">Article</h1>\n',
  options: undefined }
*/

Basic theme

const { render, basicTheme } = require('maren-core');

/* your markdown string */
const markdown = '# Article';

/* output depends on the theme */
const output = render(markdown, basicTheme);

console.log(output);
/*
<html>...</html>
*/

Tests

npm test