A drop-folder service running in Node, which strips out unwanted attributes from SVG files.
This is a proof-of-concept, and needs work to be more robust and configurable. It is not an XML parser; and may break XML files that have other content that matches the attribute name you wish to remove.
In its current state, it strips sodipodi
- and inkscape
-namespaced attributes, which solves the problem I had with my files (Inkscape content in Adobe Illustrator, exported to SVG).
- Edit the
svg_clean.config
JSON file. You can include many items in the watchedFolders array. If no.outputFolder
is specified, it will default to the.defaultOutputFolder
. node svg_clean.js
- Implement more options in
svg_clean.config
:watchedFolders[].processExisting
and.destroyInputFile
- Watch the .config file, and re-initialize on change.
- Scan the folder on initial run; fs.watch does not do this.
- Unit tests.
- Optimisation: ensure all operations are async.
- Use array method to remove many attributes.
- Use Chokidar?