Skip to content

A drop-folder service running in Node, which strips out unwanted attributes from SVG files.

Notifications You must be signed in to change notification settings

j5v/svg-cleaner

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

svg-cleaner

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).

Usage

  • 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

Todo:

  1. Implement more options in svg_clean.config: watchedFolders[].processExisting and .destroyInputFile
  2. Watch the .config file, and re-initialize on change.
  3. Scan the folder on initial run; fs.watch does not do this.
  4. Unit tests.
  5. Optimisation: ensure all operations are async.
  6. Use array method to remove many attributes.
  7. Use Chokidar?

About

A drop-folder service running in Node, which strips out unwanted attributes from SVG files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published