0.0.7 • Published 3 months ago

@xilerth/svg-splitter v0.0.7

Weekly downloads
-
License
(MIT)
Repository
-
Last release
3 months ago
! This library is still in alpha phase, please be careful with version changes and using it in production projects

SVG Values Calculator

A simple npm package to calculate values from SVG files.

Installation

npm install @xilerth/svg-splitter

Usage

const svgValuesCalculator = require("@xilerth/svg-splitter");

// Calculate values from SVG file
const filePath = "path/to/your/svg/file.svg";
const result = svgValuesCalculator.calculateValuesFromSVGFile(filePath);
console.log(result);

// Calculate values from SVG content
const svgContent = '<svg>...</svg>';
const resultContent = svgValuesCalculator.calculateValuesFromSVGFileContent(svgContent);
console.log(resultContent);

Functions

calculateValuesFromSVGFile(filePath)

Calculates values from an SVG file.

  • filePath: Path to the SVG file.
const result = svgValuesCalculator.calculateValuesFromSVGFile("path/to/your/svg/file.svg");
console.log(result);

calculateValuesFromSVGFileContent(svgContent)

Calculates values from SVG content.

  • svgContent: SVG content as a string.
const result = svgValuesCalculator.calculateValuesFromSVGFileContent(svgContent);
console.log(result);

Example

const svgValuesCalculator = require("svg-values-calculator");

// Example SVG content
const svgContent = `
<svg>
  <path id="path1" d="M10 10 L20 20" fill="#ff0000"/>
  <path id="path2" d="M30 30 L40 40" fill="#00ff00"/>
</svg>
`;


// Calculate values
const result = svgValuesCalculator.calculateValuesFromSVGFileContent(svgContent);
console.log(result);

License

This project is licensed under the MIT License - see the LICENSE.md file for details.

Changelog

0.0.7:

Now each level will appear between "~" in the full name and will still be separated by "_"
0.0.7

3 months ago

0.0.6

3 months ago

0.0.5

3 months ago

0.0.4

3 months ago

0.0.3

3 months ago

0.0.2

3 months ago

0.0.1

3 months ago

0.0.0-alpha.3

3 months ago

0.0.0-alpha.2

3 months ago

0.0.0-alpha.1

3 months ago