Skip to content

Commit 5273ae1

Browse files
committed
update readme and add license
1 parent 212f084 commit 5273ae1

File tree

2 files changed

+45
-2
lines changed

2 files changed

+45
-2
lines changed

LICENSE

+21
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT) - http://opensource.org/licenses/MIT
2+
3+
Copyright (c) 2013 Peter-Paul van Gemerden <[email protected]>
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in
13+
all copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21+
THE SOFTWARE.

README.md

+24-2
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,8 @@ Parse and manipulate SVG `<path>`s.
66

77
## Usage example
88

9+
### Parsing
10+
911
var svgPath = require('svg-path')
1012

1113
var pathData = 'm100,1e2C125,100 130,110 150,150l-25-75z'
@@ -22,11 +24,31 @@ Parse and manipulate SVG `<path>`s.
2224
]
2325
*/
2426

25-
// Apply transformations:
27+
### Applying transformations
2628

29+
var path = svgPath(pathData)
2730
path.abs()
2831
path.matrix(1, 0, 0, 1, 100, 50) // same as translate(100, 50)
2932

30-
// Transformations are applied in-place. To retain the original, create a copy first:
33+
Transformations are applied in-place. To retain the original, create a copy first:
3134

3235
var newPath = path.copy()
36+
37+
Available transformations are `abs`, `translate`, `scale`, `rotate`, `skewX` and `skewY` and `convertArcs`. The latter converts all `A` (arc) commands to `C` (curveto) commands. All transformations expect `#abs()` start by calling `#convertArcs`.
38+
39+
## Running the tests
40+
41+
$ git clone https://github.com/PPvG/svg-path
42+
$ cd svg-path
43+
$ npm install
44+
$ npm test
45+
46+
### Code coverage report
47+
48+
$ npm run cover
49+
50+
Then open `./cov/report.html` in your browser.
51+
52+
## License
53+
54+
[MIT](https://raw.github.com/PPvG/svg-path/master/LICENSE)

0 commit comments

Comments
 (0)