Exciting release!Introducing "safe npm". Learn more
Socket
Log inDemoInstall

ssi

Package Overview
Dependencies
2
Maintainers
1
Versions
8
Issues
File Explorer

Advanced tools

ssi

Server Side Includes for NodeJS

    0.3.0latest
    GitHub

Version published
Maintainers
1
Weekly downloads
710
increased by5.97%

Weekly downloads

Readme

Source

node-ssi

Build Status

Server Side Includes for NodeJS

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

<!--#include virtual="" --> <!--#include file="" --> <!--#set var="" value="" --> <!--#echo var="" --> <!--#if expr="" --> <!--#elif expr="" --> <!--#else --> <!--#endif -->

Installation

npm install ssi

Usage

var ssi = require("ssi"); var inputDirectory = "/tmp/test"; var outputDirectory = "/tmp/output"; var matcher = "/**/*.shtml"; var includes = new ssi(inputDirectory, outputDirectory, matcher); includes.compile();

If you want to support loosened spaces in directive like <!-- #include file="" --> or <!-- #include file="" -->, just enable the fourth argument: new ssi(inputDirectory, outputDirectory, matcher, true).

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

Keywords

FAQs

Last updated on 02 Jan 2016

Did you know?

Socket installs a Github app to automatically flag issues on every pull request and report the health of your dependencies. Find out what is inside your node modules and prevent malicious activity before you update the dependencies.

Install Socket
Socket
support@socket.devSocket SOC 2 Logo

Product

  • Package Issues
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc