Socket
Socket
Sign inDemoInstall

node-ssi

Package Overview
Dependencies
2
Maintainers
1
Versions
10
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    node-ssi

A SSI parser


Version published
Weekly downloads
1.2K
increased by11.72%
Maintainers
1
Install size
90.0 kB
Created
Weekly downloads
 

Readme

Source

node-ssi

NPM version Downloads Build Status Dependency status Build status Built with Grunt

A server-side-include system for nodejs.

We only support parts of nginx ssi syntax:

  <!--# include file="path" -->
  <!--# include virtual="path" -->

  <!--# set var="k" value="v" -->

  <!--# echo var="n" default="default" -->

  <!--# if expr="test" -->
  <!--# elif expr="" -->
  <!--# else -->
  <!--# endif -->

Note:

  • file includes are always relative to the baseDir provided in the options.
  • virtual includes are relative to the current file.

usage

var SSI = require('node-ssi');
var ssi = new SSI({
        baseDir: './html/',
        encoding: 'utf-8'
        payload: {
            v: 5
        }
    });

// handle a file
ssi.compileFile('index.html', {payload:{title: 'Index'}}, function(err, content){

    });

//handle a content
ssi.compile('<!--# echo var="v" default="default" -->', function(err,content){

    });

test

grunt test

changelog

  • 2014-11-03[17:00:51]:support special chars like \n,\v etc.
  • 2014-12-04[12:39:20]:thanks for @nfriedly,we fixed some bugs and support more features

todo

better lexer

license

MIT

Keywords

FAQs

Last updated on 14 Apr 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • 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