# mujer

> Practical SVG processing tools for optimize, transform, format conversion, with JavaScript API for Node.js and browser and Command Line Interface

Latest version **0.0.5** (published 2019-07-10) · MIT license · 0 weekly downloads

## Install

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

Provides the commands `svg2pdf`, `svg-optimize`, `svg-simplify-paths`.

## Health

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

Positive: has types; no vulnerabilities; high quality score.

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

Negative: insecure dependencies; abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.5 |
| Published | 2019-07-10 |
| First published | 2019-06-24 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 5 |
| Unpacked size | 63.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 4 |
| Author | Sebastian Gurin |
| Maintainers | cancerberosgx |
| Keywords | svg, JavaScript, browser, Node.js, optimization, transformation, format, conversion, CLI |

## Links

- npm: https://www.npmjs.com/package/mujer
- Repository: https://github.com/cancerberoSgx/mujer
- Homepage: https://www.npmjs.com/package/mujer
- Issues: https://github.com/cancerberoSgx/mujer
- npm.io page: https://npm.io/package/mujer

## Dependencies (5)

- [svgo](https://npm.io/package/svgo.md) github:cancerberosgx/svgo
- [paper](https://npm.io/package/paper.md) ^0.12.3
- [paper-jsdom](https://npm.io/package/paper-jsdom.md) ^0.12.3
- [paper-jsdom-canvas](https://npm.io/package/paper-jsdom-canvas.md) ^0.12.3
- [misc-utils-of-mine-generic](https://npm.io/package/misc-utils-of-mine-generic.md) ^0.2.15

## Alternatives

- [@salesforce/cli](https://npm.io/package/@salesforce/cli.md) — 389.7K weekly downloads
- [@mintlify/cli](https://npm.io/package/@mintlify/cli.md) — 208.9K weekly downloads
- [@grafana/e2e-selectors](https://npm.io/package/@grafana/e2e-selectors.md) — 128.7K weekly downloads
- [mintlify](https://npm.io/package/mintlify.md) — 112.0K weekly downloads
- [@intlayer/cli](https://npm.io/package/@intlayer/cli.md) — 22.8K weekly downloads

## Recent versions

- 0.0.5 (latest) — 2019-07-10
- 0.0.4 — 2019-07-10
- 0.0.3 — 2019-07-10
- 0.0.2 — 2019-06-24

## README

# Mujer



# Contents

<!-- toc -->

- [Summary](#summary)
- [Install](#install)
- [Tools](#tools)
  * [optimizeSvg](#optimizesvg)
    + [Command line](#command-line)
    + [API](#api)
    + [Options](#options)
  * [svg2pdf](#svg2pdf)
    + [Command line](#command-line-1)
    + [API](#api-1)
  * [simplifyPaths](#simplifypaths)
    + [Command line](#command-line-2)
    + [API](#api-2)
    + [Options](#options-1)
- [TODO / Status / Roadmap](#todo--status--roadmap)

<!-- tocstop -->

# Summary

Practical tools for vector graphics:
 * High level - easy to use
 * APIs for Node.js and Browser
 * Command line tools
 * Optimization
 * Transformations
 * Format conversion
 * more to come...

# Install

```sh
npm install mujer
```
# Tools

## optimizeSvg

Minimizes SVG code size using [svgo](TODO) and optionally simplifyPaths utility.

### Command line

```sh
svg-optimize --input "some/**/*.svg" --output output/folder
```

### API

```ts
import {optimizeSvg} from 'mujer'

// We must pass the SVG code as input, in this case we read a file in node
// In the browser we could obtain the SVG code with a request or from a DOM Element
var output = await optimizeSvg({
  input: readFileSync('foo/bar.svg').toString()
})

// In node we could write the output to a file:
writeFileSync('foo/bar_optimized.svg', output)

// in the browser I could render in the document:
document.getElementById('svg-container').innerHTML = output
```

### Options

TODO


## svg2pdf  

### Command line

```sh
svg2pdf --input "some/**/*.svg" --output output/folder
```

### API

```ts
import {svg2pdf} from 'mujer'

const pdf = await svg2pdf({
  input: './test/assets/test2.svg', 
  width: 1000, 
  height: 1000
})

// in node.js I could save it to a file
writeFileSync('output.pdf', pdf)

// in the browser I could make the user to download
// TODO: example
```

## simplifyPaths

### Command line

```sh
svg-simplify-paths --input "some/**/*.svg" --output output/folder --tolerance 3
```

### API

```ts
import {svg2pdf} from 'mujer'

var output = await simplifyPaths({
  input: 'test2.svg', 
  width: 1000, 
  height: 1000,
  tolerance: 5
})

// in node.js I could save it to a file
writeFileSync('test2_simplified.svg', output)

// in the browser I could render in the document:
document.getElementById('svg-container').innerHTML = output
```

### Options

TODO


# TODO / Status / Roadmap

- [ ] Command line

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