Security News
Bun 1.2 Released with 90% Node.js Compatibility and Built-in S3 Object Support
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
[![npm version](https://badge.fury.io/js/computron.svg)](https://badge.fury.io/js/computron) [![Build Status](https://travis-ci.org/Inist-CNRS/computron.svg?branch=master)](https://travis-ci.org/Inist-CNRS/computron)
Computron is a Node.js library for applying XSLT stylesheets to XML documents. It's also a C++ addon for nodejs which means it uses pure C++ code whith the help of libxslt library.
This version has been tested in Ubuntu 18.04 with NodeJS v10.
sudo apt install cmake g++ libxml2-dev libxslt1-dev
npm install computron
const Computron = require('computron');
const transformer = new Computron();
transformer.loadStylesheet('path/to/my/file.xsl', error => {
if (error) return console.log('dammit');
transformer.apply('path/to/my/file.xml', (error, result) => {
if (error) return console.log('bloody hell');
// do something with the result
});
});
Promises with the help of bluebird package
const Promise = require('bluebird');
const Computron = require('computron');
Promise.promisifyAll(Computron.prototype);
const transformer = new Computron();
transformer.loadStylesheetAsync('path/to/my/file.xsl')
.then(() => transformer.applyAsync('path/to/my/file.xml'))
.then(result => {
// do something with the result
})
.catch(console.error)
});
Computron.loadStylesheet(string, callback)
Computron.loadStylesheet('path/to/my/file.xsl', error => {
// ...
});
Computron.apply(string, [obj], callback)
// With params
Computron.apply('path/to/my/file.xml', { name: 'John DOE' }, (error, result) => {
// ...
});
// Without params
Computron.apply('path/to/my/file.xml', (error, result) => {
// ...
});
FAQs
Computron is a Node.js library to apply XSLT stylesheets to XML documents.
The npm package computron receives a total of 32 weekly downloads. As such, computron popularity was classified as not popular.
We found that computron demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 2 open source maintainers collaborating on the project.
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.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.
Security News
Biden's executive order pushes for AI-driven cybersecurity, software supply chain transparency, and stronger protections for federal and open source systems.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.