API Keys

CompressionAPI key
No API keys found
Loading...

* Each beta tester is given ONE unique API key for a maximum of 500 SVG compression.

Applications

  • NPM
  • CLI
  • Gulp

Installation

npm install nanosvg

Usage

var Nano = require('nanosvg'),
    nano = new Nano({
                key: "YOUR API KEY",
                mode: "COMPRESSION MODE" // image mode = 0, object mode = 1
            });

    // compress in bulk
    nano.compress('./*.svg', './compressed/').then(function () {
        console.log('Compression done');
    });
                

Installation

npm install -g nanosvg

Usage

//Compress single file
nanosvg "./to-compress.svg" ./compressed/ --key "YOUR API KEY" --mode "COMPRESSION MODE"

//Compress using glob
nanosvg "./*.svg" ./compressed/ --key "YOUR API KEY" --mode "COMPRESSION MODE"
                

Installation

npm install gulp-nano

Usage

var gulp = require('gulp'),
    nano = require('gulp-nano');

    gulp.task('Compress SVG', function () {
        return gulp.src('./*.svg')
            .pipe(nano({ key: "YOUR API KEY", mode: "COMPRESSION MODE" }))
            .pipe(gulp.dest('./compressed/'));
    });
                

What's next?

  1. More than 10 SVG files compression on browser

  2. Plugins for other SVG editors and Wordpress

  3. Customize attributes to compress

Stay tuned!

Questions? Feedback?

Join the community and send your feedback to us.

We would love to hear from you!

Please confirm that you want to remove this API key
Removing your API key will disable and invalidate your API key permanently.

Are you sure you want to permanently remove your API key?
Oops, our current Beta is by invitation only
Please sign in with your registered email.

Still having problems? Drop us an email at [email protected]