rougher

1.1.2 • Public • Published

rougher ✏️

Rough up an SVG using Rough.js.

Table of contents

Install

To install:

npm install rougher

Or if you prefer using Yarn:

yarn add rougher

Usage

CLI

To get help:

rougher --help

To process a file and output to stdout:

rougher input.svg

To process a file and output to a file:

rougher input.svg -o output.svg

To pipe the output of another command into rougher:

cat input.svg | rougher

Node (ESM)

import { readFileSync } from "fs";
import roughUp from "rougher";

const inputContents = readFileSync("input.svg");
console.log(roughUp(inputContents.toString()));

Node (CJS)

const { readFileSync } = require("fs");
const roughUp = require("rougher");

const inputContents = readFileSync("input.svg");
console.log(roughUp(inputContents.toString()));

Browser (ESM)

<script type="module">
  import rougher from "https://unpkg.com/rougher/dist/browser/rougher.mjs";

  rougher(document.getElementById("svg"));
</script>

Browser (IIFE)

<script src="https://unpkg.com/rougher/dist/browser/rougher.js"></script>
<script>
  rougher(document.getElementById("svg"));
</script>

Build

To build:

npm run build

To continuously build on changes:

npm run watch:build

Test

To run linting and unit tests:

npm test

To run just unit tests:

npm run test:unit

To continuously run unit tests on changes:

npm run watch:unit

Meta

Contributors

License

This is free software, and may be redistributed under the terms specified in the LICENSE file.

Readme

Keywords

none

Package Sidebar

Install

npm i rougher

Weekly Downloads

1

Version

1.1.2

License

MIT

Unpacked Size

272 kB

Total Files

11

Last publish

Collaborators

  • unindented