# node-xsltproc

> wrapper around xsltproc with profiling information

Latest version **1.2.1** (published 2021-02-24) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install node-xsltproc
pnpm add node-xsltproc
yarn add node-xsltproc
bun add node-xsltproc
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.2.1 |
| Published | 2021-02-24 |
| First published | 2017-01-12 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Unpacked size | 18.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | ticapix |
| Maintainers | ticapix |
| Keywords | xsltproc |

## Links

- npm: https://www.npmjs.com/package/node-xsltproc
- Repository: https://github.com/ticapix/node-xsltproc
- Homepage: https://github.com/ticapix/node-xsltproc#readme
- Issues: https://github.com/ticapix/node-xsltproc/issues
- npm.io page: https://npm.io/package/node-xsltproc

## Recent versions

- 1.2.1 (latest) — 2021-02-24
- 1.2.0 — 2021-02-24
- 1.1.1 — 2017-01-13
- 1.1.0 — 2017-01-13
- 1.0.1 — 2017-01-13
- 1.0.0 — 2017-01-12

## README

# node-xsltproc

[![Build Status](https://travis-ci.org/ticapix/node-xsltproc.svg?branch=master)](https://travis-ci.org/ticapix/node-xsltproc)

## Getting started

First install xsltproc. If not already installed on your system, read [installing an XSLT processor](http://www.sagehill.net/docbookxsl/InstallingAProcessor.html).

Install the module with: `npm install node-xsltproc --save`

### Options

#### xsltproc options

- `xsltproc_path` : specify the path for xsltproc

#### transform options

- `debug` : add extra verbose message (default: false)
- `stringparams` : add stringparam (default: {})
- `metadata` : whether metadata should be parsed from xsltproc output (default: true)

### Exemples

#### using an optional path for xsltproc

```javascript
const xsltproc = require('node-xsltproc');

xsltproc({xsltproc_path: '/home/user/local/bin'}).transform('test/fixtures/page.xml').then((data) => {
	console.log('metadata', data.metadata);
	console.log('output', data.result);
});
```

```text
metadata { message: '',
  functions:
   [ { id: 0,
       fctName: 'page',
       count: 1,
       total: 5,
       avg_100us: 5,
       source: 'page.xsl',
       line: 5 } ],
  includes: [ 'page.xml', 'variables.dtd', 'page.xsl', 'menu.xsl' ] }
output <h1>My</h1> <h2>page content</h2>
```

#### using stylesheet+xml files

```javascript
const xsltproc = require('node-xsltproc');

xsltproc().transform(['test/fixtures/menu.xsl', 'test/fixtures/menu.xml']).then((data) => {
	console.log(data.metadata);
	console.log(data.result);
});
```

#### using stringparam

```javascript
const xsltproc = require('node-xsltproc');

xsltproc().transform('test/fixtures/params.xml'), {stringparams: {n: '42'}}).then((data) => {
  console.log(data.metadata);
  console.log(data.result);
});
```

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