# scale-that-svg

Latest version **1.0.6** (published 2023-01-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install scale-that-svg
pnpm add scale-that-svg
yarn add scale-that-svg
bun add scale-that-svg
```

## Health

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

Positive: esm support; no vulnerabilities.

Warnings: low downloads; no types.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.6 |
| Published | 2023-01-18 |
| First published | 2018-06-06 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 3 |
| Unpacked size | 139.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 20 |
| Author | Lionel T |
| Maintainers | elrumordelaluz |
| Keywords | svg, path, paths, manipulation, tools |

## Links

- npm: https://www.npmjs.com/package/scale-that-svg
- Repository: https://github.com/elrumordelaluz/scale-that-svg
- Homepage: https://github.com/elrumordelaluz/scale-that-svg#readme
- Issues: https://github.com/elrumordelaluz/scale-that-svg/issues
- npm.io page: https://npm.io/package/scale-that-svg

## Dependencies (3)

- [svgson](https://npm.io/package/svgson.md) 3.0.0
- [svg-path-tools](https://npm.io/package/svg-path-tools.md) 1.0.0
- [element-to-path](https://npm.io/package/element-to-path.md) 1.2.0

## Alternatives

- [base64url](https://npm.io/package/base64url.md) — 6.1M weekly downloads
- [get-installed-path](https://npm.io/package/get-installed-path.md) — 502.9K weekly downloads
- [@uppy/url](https://npm.io/package/@uppy/url.md) — 185.8K weekly downloads
- [@d3fc/d3fc-shape](https://npm.io/package/@d3fc/d3fc-shape.md) — 16.2K weekly downloads
- [localizer](https://npm.io/package/localizer.md) — 226 weekly downloads

## Recent versions

- 1.0.6 (latest) — 2023-01-18
- 1.0.5 — 2020-08-03
- 1.0.4 — 2020-07-20
- 1.0.3 — 2018-07-17
- 1.0.2 — 2018-07-17
- 1.0.1 — 2018-07-17
- 1.0.0 — 2018-06-06

## README

<p align="center">
  <img alt="Scale that SVG!" title="Scale that SVG!" src="https://cdn.rawgit.com/elrumordelaluz/scale-that-svg/880c705b/logo.svg" width="450">
</p>

<p align="center">
  Scale that <code>svg</code>, period.
</p>

## Install

```zsh
yarn add scale-that-svg
```

## Usage

```js
const { scale } = require('scale-that-svg')

fs.readFile('./test.svg', (err, input) => {
  scale(input, { scale: 0.5 }).then((scaled) => {
    console.log({ scaled })
  })
})

scale(`<svg viewBox="0 0 500 200">
  <rect
    x="200"
    y="50"
    fill="#F16362"
    stroke="#30456B"
    stroke-width="5"
    stroke-linecap="round"
    stroke-linejoin="round"
    width="100" height="100"/>
</svg>`).then((scaledFromString) => console.log({ scaledFromString }))
```

## API

### scale(input,[options])

#### input

Type: `string|buffer`
SVG to scale

#### options

Type: `Object`
Based on [svg-path-tool scale](https://github.com/elrumordelaluz/path-utils/blob/master/src/scale.js)

##### scale

Type: `number`<br>
Default: 1 (no scale)

##### scaleY

Type: `number`<br>
If no specified, same as `scale`

##### round

Type: `number`<br>
Default: 3

## Related

[element-to-path](https://github.com/elrumordelaluz/element-to-path) Convert SVG element into `path`

[path-that-svg](https://github.com/elrumordelaluz/path-that-svg) Convert entire SVG with `path`

[svg-path-tools](https://github.com/elrumordelaluz/svg-path-tools) Tools to manipulate SVG `path` (d)

[svgson](https://github.com/elrumordelaluz/svgson) Transform SVG into `Object`

## License

MIT © [Lionel Tzatzkin](https://lionel.tzatzk.in)

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