Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

svgo

Package Overview
Dependencies
Maintainers
1
Versions
104
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

svgo - npm Package Compare versions

Comparing version 0.1.1 to 0.1.2

6

CHANGELOG.md

@@ -0,1 +1,7 @@

### [ [>](//github.com/svg/svgo/tree/v0.1.2) ] 0.1.2 / 24.11.2012
* lib/svgo/svg2js: correct 'onerror' failure (fix #51](https://github.com/svg/svgo/issues/51))
* config: disable sax-js position tracking by default (fix #52](https://github.com/svg/svgo/issues/52))
* lib/svgo: rename 'startBytes' to 'inBytes' and 'endBytes' to 'outBytes (close #53](https://github.com/svg/svgo/issues/53))
* plugins/removeUnknownsAndDefaults: remove SVG id attr (close #54](https://github.com/svg/svgo/issues/54))
### [ [>](//github.com/svg/svgo/tree/v0.1.1) ] 0.1.1 / 23.11.2012

@@ -2,0 +8,0 @@ * plugins/moveElemsAttrsToGroup: fix inheitable only attrs array (fix [#47](https://github.com/svg/svgo/issues/47))

8

examples/fromFile.js

@@ -8,5 +8,5 @@ var SVGO = require('../lib/svgo'),

// get optimized result
.then(function(min) {
.then(function(result) {
console.log(min);
console.log(result);
// output:

@@ -20,4 +20,4 @@ // {

// height: '20',
// startBytes: 59,
// endBytes: 38
// inBytes: 59,
// outBytes: 38
// }

@@ -24,0 +24,0 @@ // }

@@ -13,5 +13,5 @@ var FS = require('fs'),

// get optimized result
.then(function(min) {
.then(function(result) {
console.log(min);
console.log(result);
// output:

@@ -25,4 +25,4 @@ // {

// height: '20',
// startBytes: 59,
// endBytes: 38
// inBytes: 59,
// outBytes: 38
// }

@@ -29,0 +29,0 @@ // }

@@ -8,5 +8,5 @@ var SVGO = require('../lib/svgo'),

// get optimized result
.then(function(min) {
.then(function(result) {
console.log(min);
console.log(result);
// output:

@@ -20,4 +20,4 @@ // {

// height: '20',
// startBytes: 52,
// endBytes: 38
// inBytes: 52,
// outBytes: 38
// }

@@ -24,0 +24,0 @@ // }

@@ -57,8 +57,8 @@ /**

var out = JS2SVG(PLUGINS(jsdata, config.plugins), config.js2svg);
var result = JS2SVG(PLUGINS(jsdata, config.plugins), config.js2svg);
out.info.startBytes = Buffer.byteLength(str, 'utf-8');
out.info.endBytes = Buffer.byteLength(out.data, 'utf-8');
result.info.inBytes = Buffer.byteLength(str, 'utf-8');
result.info.outBytes = Buffer.byteLength(result.data, 'utf-8');
return out;
return result;

@@ -65,0 +65,0 @@ });

@@ -132,3 +132,3 @@ var FS = require('fs'),

return svgo.then(function(svgmin) {
return svgo.then(function(result) {

@@ -138,3 +138,3 @@ // --datauri

// convert to Data URI base64 string
svgmin.data = encodeSVGDatauri(svgmin.data);
result.data = encodeSVGDatauri(result.data);
}

@@ -144,3 +144,3 @@

if (output === '-' || (input === '-' && !output)) {
process.stdout.write(svgmin.data + '\n');
process.stdout.write(result.data + '\n');
}

@@ -158,3 +158,3 @@

output = FS.createWriteStream(output, { encoding: 'utf8' });
output.write(svgmin.data);
output.write(result.data);
output.end();

@@ -166,3 +166,3 @@

// print optimization profit info
printProfitInfo(svgmin.info.startBytes, svgmin.info.endBytes);
printProfitInfo(result.info.inBytes, result.info.outBytes);

@@ -238,10 +238,10 @@ }

return svgo.fromFile(item)
.then(function(svgmin) {
.then(function(result) {
var output = FS.createWriteStream(item, { encoding: 'utf8' });
output.write(svgmin.data);
output.write(result.data);
output.end();
UTIL.puts(filename + ':');
printProfitInfo(svgmin.info.startBytes, svgmin.info.endBytes);
printProfitInfo(result.info.inBytes, result.info.outBytes);

@@ -248,0 +248,0 @@ });

@@ -1,3 +0,2 @@

var UTIL = require('util'),
Q = require('q'),
var Q = require('q'),
SAX = require('sax'),

@@ -111,4 +110,3 @@ JSAPI = require('./jsAPI');

UTIL.error(('\n\033[31m' + 'XML parser error:' + '\033[m' + ' something wrong with your svg file ("' + e.message + '")\n'));
process.exit(1);
throw new Error('svg2js: ' + e.message);

@@ -115,0 +113,0 @@ };

{
"name": "svgo",
"version": "0.1.1",
"version": "0.1.2",
"description": "Nodejs-based tool for optimizing SVG vector graphics files",

@@ -5,0 +5,0 @@ "keywords": [ "svgo", "svg", "optimize", "minify" ],

@@ -47,2 +47,7 @@ var flattenOneLevel = require('../lib/svgo/tools').flattenOneLevel,

// remove SVG id attr
if (params.SVGid && elem === 'svg') {
item.removeAttr('id');
}
// remove unknown element's content

@@ -49,0 +54,0 @@ if (

![logo](https://raw.github.com/svg/svgo/master/logo200x200.png)
## SVGO v0.1.1 [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)
## SVGO v0.1.2 [![Build Status](https://secure.travis-ci.org/svg/svgo.png)](http://travis-ci.org/svg/svgo)

@@ -105,2 +105,3 @@ **SVG** **O**ptimizer is a Nodejs-based tool for optimizing SVG vector graphics files.

* [v0.1.2](https://github.com/svg/svgo/issues?milestone=4&state=open)
* [v0.1.3](https://github.com/svg/svgo/issues?milestone=4&state=open)

@@ -107,0 +108,0 @@

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc