static-engine-defaults
v6.14.2
Published
Plugin for static-engine. Reads defaults for objects in the collection from a file and uses a converter that you define like JSON.parse.
Downloads
66
Readme
static-engine-defaults
This is a plugin for static-engine. Reads default properties from a file and then uses object-assign to apply them to the existing objects. It should not overwrite existing properties but should set ones that don't exist. Call it with the path to the file and a converter for the content like JSON.parse.
var engine = require('static-engine')
var defaults = require('static-engine-defaults')
var cson = require('cson-parser')
var pluginA = require('plugin-a')
engine([
pluginA,
defaults('./content/defaults.cson', cson.parse)
])