rougher
v1.1.2
Published
Rough up an SVG using Rough.js.
Readme
rougher ✏️
Rough up an SVG using Rough.js.
Table of contents
Install
To install:
npm install rougherOr if you prefer using Yarn:
yarn add rougherUsage
CLI
To get help:
rougher --helpTo process a file and output to stdout:
rougher input.svgTo process a file and output to a file:
rougher input.svg -o output.svgTo pipe the output of another command into rougher:
cat input.svg | rougherNode (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 buildTo continuously build on changes:
npm run watch:buildTest
To run linting and unit tests:
npm testTo run just unit tests:
npm run test:unitTo continuously run unit tests on changes:
npm run watch:unitMeta
- Code:
git clone git://github.com/unindented/rougher.git - Home: https://github.com/unindented/rougher
Contributors
- Daniel Perez Alvarez (https://github.com/unindented)
License
This is free software, and may be redistributed under the terms specified in the LICENSE file.
