Expressful content
Give JSON and CSON superpowers for content management
$ npm install expressful-content --save
Quick start
Expressful content makes it easy to use a flat file based content system. You can use this to move your content out of your views. This makes it easy to plugin a flat file CMS.
// app.jsconst parseFile = parseFile;const path = ; const CONTENT_DIRECTORY = path; ;
Returns:
title: 'Homepage' brandName: 'Expressful content' posts: title: 'My first article' title: 'My second article'
Given the following structure:
.
|-- /app.js
|-- /content
| |-- /homepage.cson
| |-- /global.json
| |-- /blog
| |-- 2016__07__10__first-article.cson
| |-- 2016__07__11__second-article.cson
./content/homepage.cson
title: "Homepage" __extend: "global.cson", __list: directory: 'blog', as: 'posts'
global.json
2016__07__10__first-article.cson
title: "My first article"
2016__07__11__second-article.cson.cson
title: "My second article"