Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add svgo-browser link readme #1275

Closed
wants to merge 1 commit into from
Closed

Add svgo-browser link readme #1275

wants to merge 1 commit into from

Conversation

rtivital
Copy link

@rtivital rtivital commented Aug 13, 2020

Привет! Hello, I've made a version of svgo that works in browsers (with help of build tools like webpack). With this pull request I've added link to it.

Link – https://github.com/rtivital/svgo-browse

Here is an API example:

// Test data will be used in all examples to illustrate output
const testData = `
  <svg version="1.1" width="10" height="20">
      test
  </svg>
`;

Optimize with all default configuration:

import optimize from 'svgo-browser/lib/optimize ';

optimize(testData).then(console.log); // -> <svg viewBox="0 0 10 20">test</svg>

Get separate instance:

import getSvgoInstance from 'svgo-browser/lib/get-svgo-instance';

const svgo = getSvgoInstance();
svgo.optimize(testData).then(console.log); // -> { data: "<svg viewBox="0 0 10 20">test</svg>", info: {}}

@TrySound TrySound closed this Feb 13, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants