Skip to content

romain-sen/node-redac

 
 

Repository files navigation

Redac

Redac is a content authoring library to source content into your website. The library handles Markdown, MDX, Yaml files by default.

Installation

Redac is only available as an ESM package for now. Please drop a feature request if you desire a CommonJS version.

Install the dependency into your package using your favorite package manager.

npm install redac

Usage

Import the redac package, source some data and start querying your dataset.

Short form:

// Import the redac package
import redac from 'redac'
// Initializethe engine
const articles = await redac
  // Source Markdown documents
  .mdx('./articles')
  // Start querying
  .from('articles')
  .filter( document => document.lang === 'fr')
  .list()

Long form:

// Import the redac package
import redac from 'redac'
// Initialize the engine
const engine = redac([
  // Source Markdown documents
  {
    module: 'redac/plugins/mdx',
    config: './articles',
  },
  // Source Yaml documents
  {
    module: 'redac/plugins/yaml',
    config: './tags',
  },
])
// Start querying
const articles = await engine
  .from('articles')
  .filter((document) => document.lang === 'fr')
  .list()

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • JavaScript 99.9%
  • Shell 0.1%