climenty / svg-join Goto Github PK
View Code? Open in Web Editor NEWNode.js-based tool for joining SVG vector graphics files.
Node.js-based tool for joining SVG vector graphics files.
Even just running 'svg-join' without parameters gives me the following error:
Thomass-MacBook-Pro:o2 tom$ svg-join
/usr/local/lib/node_modules/svg-join/svg-join.js:14
const parseUnit = (value = '') => value.replace(/[\d.\s]/g, '')
^
SyntaxError: Unexpected token =
at exports.runInThisContext (vm.js:53:16)
at Module._compile (module.js:373:25)
at Object.Module._extensions..js (module.js:416:10)
at Module.load (module.js:343:32)
at Function.Module._load (module.js:300:12)
at Module.require (module.js:353:17)
at require (internal/module.js:12:17)
at Object.<anonymous> (/usr/local/lib/node_modules/svg-join/bin/svg-join:3:1)
at Module._compile (module.js:409:26)
at Object.Module._extensions..js (module.js:416:10)
The node version I´m running is v4.6.2
Any idea what´s going on? Some Node version issue?
svg-join -s ./icons/*.svg -o ./ -n icons
SVG-Join 1.1.1 Join svg files in symbol collection.
Successfully processed files: 0/0.
Even though the folder actually contains 127 svg files.
this file resize-100%.svg
will generate an invalid class name
.svg_resize-100% {...}
Hello,
I was looking forward using this tool, but I get an error when running this in git-bash or cmd.exe with Node 16.14 on Win10
TypeError: file.writeAsync is not a function
at Object.<anonymous> (C:\Users\WebMechanic\AppData\Roaming\npm\node_modules\svg-join\svg-join.js:108:6)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Module.require (node:internal/modules/cjs/loader:1005:19)
at require (node:internal/modules/cjs/helpers:102:18)
at Object.<anonymous> (C:\Users\WebMechanic\AppData\Roaming\npm\node_modules\svg-join\bin\svg-join:3:1)
at Module._compile (node:internal/modules/cjs/loader:1103:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1155:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
at node:internal/main/run_main_module:17:47
bash: svg-join -s "./wia-icons/wia*.svg" -o "./svgs/" -n "icons" -p "wia-"
I'm a noob if it comes to Node fs calls, so I have no clue where to go from here.
Help?
Tried to clean the following svg:
<svg width="52" height="52" viewBox="0 0 52 52" fill="none" xmlns="http://www.w3.org/2000/svg"> <path d="M39 21.666H36.27C35.4593 18.5265 33.7844 15.6773 31.4354 13.4422C29.0863 11.2071 26.1575 9.67566 22.9816 9.02195C19.8057 8.36823 16.5102 8.61844 13.4694 9.74413C10.4286 10.8698 7.76451 12.8259 5.77987 15.39C3.79523 17.9541 2.5696 21.0235 2.24225 24.2494C1.91491 27.4753 2.49897 30.7284 3.92807 33.6389C5.35717 36.5495 7.57401 39.0008 10.3267 40.7144C13.0794 42.428 16.2575 43.3351 19.5 43.3327H39C41.8731 43.3327 44.6286 42.1913 46.6603 40.1597C48.6919 38.128 49.8333 35.3725 49.8333 32.4993C49.8333 29.6262 48.6919 26.8707 46.6603 24.839C44.6286 22.8074 41.8731 21.666 39 21.666Z" stroke="#6B7479" stroke-width="3" stroke-linecap="round" stroke-linejoin="round"/> </svg>
svg-join -s "polygon_double.svg" -o . -n mybundle
transformed
<?xml version="1.0"?>
<svg xmlns="http://www.w3.org/2000/svg" version="1.2" baseProfile="tiny" width="800" height="800" viewBox="0 0 800 800" stroke-linecap="round" stroke-linejoin="round">
<g id="polygon" fill="none" stroke="black" stroke-width="1">
<path d="M 1 799 1 1 799 1 799 799 1 799" stroke="red" stroke-width="10"/>
</g>
</svg>
into
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" style="display:none">
<symbol viewBox="0 0 800 800" id="polygon_double"><g id="polygon" fill="none" stroke="black" stroke-width="1"><path d="M 1 799 1 1 799 1 799 799 1 799" stroke="red" stroke-width="10"/></g></symbol>
</svg>
that is not opened properly in any program that I used so far for opening SVG files (Firefox, Inkscape and GNOME image preview). Is it intentional?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.