node-ssi
Server Side Includes for NodeJS
Warning: I am no longer supporting this project. If you are interested in taking over, please get in touch.
Note: The current version of ssi does all IO synchronously. Further development plans include writing methods asynchronously and migrating current methods to conform to Node conventions for synchronous methods.
Supported Instructions
Installation
npm install ssi
Usage
var ssi = require("ssi");
var inputDirectory = "/tmp/test";
var outputDirectory = "/tmp/output";
var matcher = "/**/*.shtml";
var useNginx = true;
var includes = new ssi(inputDirectory, outputDirectory, matcher, useNginx);
includes.compile();
Methods
parse(filename, contents)
filename String
path to the file
contents String
Contents of the file to be parsed
Method returns the parsed contents
compile()
Method parses all of the files found by the matcher in the input directory, and writes the files to the output directory with identical names and directory structure.
License
MIT