# mathjs-cmathml

> Extends MathJS for export to content MathML

Latest version **0.1.4** (published 2019-01-20) · Apache-2.0 license · 0 weekly downloads

## Install

```sh
npm install mathjs-cmathml
pnpm add mathjs-cmathml
yarn add mathjs-cmathml
bun add mathjs-cmathml
```

## 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.1.4 |
| Published | 2019-01-20 |
| First published | 2018-05-30 |
| Weekly downloads | 0 |
| License | Apache-2.0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 339.1 KB |
| Known vulnerabilities | 0 (+16 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 2 |
| Maintainers | metelkin, vetedde |
| Keywords | mathjs, MathML, XML |

## Links

- npm: https://www.npmjs.com/package/mathjs-cmathml
- Repository: https://github.com/insysbio/mathsjs-cmathml
- Homepage: https://github.com/insysbio/mathsjs-cmathml#readme
- Issues: https://github.com/insysbio/mathsjs-cmathml/issues
- npm.io page: https://npm.io/package/mathjs-cmathml

## Dependencies (1)

- [xmldom](https://npm.io/package/xmldom.md) *

## Alternatives

- [babylon](https://npm.io/package/babylon.md) — 5.1M weekly downloads
- [csscolorparser](https://npm.io/package/csscolorparser.md) — 3.7M weekly downloads
- [expr-eval-fork](https://npm.io/package/expr-eval-fork.md) — 1.5M weekly downloads
- [@leeoniya/ufuzzy](https://npm.io/package/@leeoniya/ufuzzy.md) — 247.7K weekly downloads
- [xml-parser](https://npm.io/package/xml-parser.md) — 78.4K weekly downloads

## Recent versions

- 0.1.4 (latest) — 2019-01-20
- 0.1.3 — 2018-10-16
- 0.1.2 — 2018-05-31
- 0.1.1 — 2018-05-30

## README

# mathsjs-cmathml

## Description

Extends mathjs http://mathjs.org/ library by function translating the internal object to content MathML https://www.w3.org/Math/

## Usage

Addon can be used in both NodeJS and in the browser.

## Installation

```
npm install mathjs-cmathml
```

## nodejs

NodeJS version uses external DOM from library `xmldom`.
```javascript
const math = require('mathjs');
math.import(require('mathjs-cmathml'));

let doc = math
    .parse('x*sin(y/z)')
    .toCMathML();
let mathml = doc.toString(); // stringify MathML
console.log(mathml);
```
## Browser

Browser version can be downloaded from https://github.com/insysbio/mathsjs-cmathml/tree/master/dist

Browser version uses internal default DOM.
```html
<script src="https://cdnjs.cloudflare.com/ajax/libs/mathjs/4.2.2/math.min.js"></script>
<script src="./mathjs.toCMathML.min.js"></script>
```

```javascript
math.import(cmathml);

let doc = math
    .parse('x*sin(y/z)')
    .toCMathML();
let mathml = new XMLSerializer().serializeToString(doc); // stringify MathML
console.log(mathml);
```
## webpack

The another entry point is used for webpack building. Webpack version uses browser DOM.
```javascript
const math = require('mathjs');
math.import(require('mathsjs-cmathml/webpack'));

let doc = math
    .parse('x*sin(y/z)')
    .toCMathML();
let mathml = new XMLSerializer().serializeToString(doc); // stringify MathML
console.log(mathml);
```
## Maintainers

 - Viktoria Tkachenko @vetedde
 - Evgeny Metelkin @metelkin

## Copyright

InSysBio, Moscow, 2017-2018
http://insysbio.com

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