# ssi

> Server Side Includes for NodeJS

Latest version **0.3.0** (published 2016-01-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install ssi
pnpm add ssi
yarn add ssi
bun add ssi
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.3.0 |
| Published | 2016-01-02 |
| First published | 2013-05-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 48 |
| Author | Chen-Heng Chang |
| Maintainers | kidwm |
| Keywords | ssi, server side includes |

## Links

- npm: https://www.npmjs.com/package/ssi
- Repository: https://github.com/kidwm/node-ssi
- Issues: https://github.com/kidwm/node-ssi/issues
- npm.io page: https://npm.io/package/ssi

## Dependencies (2)

- [glob](https://npm.io/package/glob.md) ^6.0.1
- [mkdirp](https://npm.io/package/mkdirp.md) ^0.5.1

## Alternatives

- [@sindresorhus/slugify](https://npm.io/package/@sindresorhus/slugify.md) — 3.7M weekly downloads
- [solid-js](https://npm.io/package/solid-js.md) — 2.7M weekly downloads
- [expo-glass-effect](https://npm.io/package/expo-glass-effect.md) — 2.5M weekly downloads
- [nanoassert](https://npm.io/package/nanoassert.md) — 780.8K weekly downloads
- [@ffmpeg/ffmpeg](https://npm.io/package/@ffmpeg/ffmpeg.md) — 529.5K weekly downloads

## Recent versions

- 0.3.0 (latest) — 2016-01-02
- 0.2.0 — 2015-12-21
- 0.1.5 — 2014-06-04
- 0.1.4 — 2014-06-02
- 0.1.3 — 2013-10-03
- 0.1.2 — 2013-07-28
- 0.1.1 — 2013-06-03
- 0.1.0 — 2013-05-25

## README

node-ssi
========

[![Build Status](https://travis-ci.org/kidwm/node-ssi.png)](https://travis-ci.org/kidwm/node-ssi)

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

```html
<!--#include virtual="" -->
<!--#include file="" -->
<!--#set var="" value="" -->
<!--#echo var="" -->

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

### Installation

```bash
npm install ssi
```

### Usage

```javascript
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

---
_Source: https://npm.io/package/ssi · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
