Code Monkey home page Code Monkey logo

resvg-js's Introduction

resvg-js

GitHub CI Status

A high-performance SVG renderer, powered by Rust based resvg and napi-rs.

  • Very fast, safe and zero dependencies!
  • Cross-platform support, including Apple M1.
  • No need for node-gyp and postinstall, the .node file has been compiled for you.

Installation

npm i @resvg/resvg-js
cnpm i @resvg/resvg-js
pnpm i @resvg/resvg-js
node example/index.js

Loaded 1 font faces in 0ms.
Font './example/SourceHanSerifCN-Light-subset.ttf':0 found in 0.006ms.
✨ Done in 55.65491008758545 ms
SVG PNG

Support matrix

Operating Systems

node12 node14 node16
Windows x64
Windows x32
Windows arm64
macOS x64
macOS arm64(M1)
Linux x64 gnu
Linux x64 musl
Linux arm gnu
Linux arm64 gnu
Linux arm64 musl
Android arm64
FreeBSD x64

Ability

Build

You can set the name of the generated .node file in napi.name of package.json.

After npm run build command, you can see resvgjs.[darwin|win32|linux].node file in project root. This is the native addon built from lib.rs.

Test

With ava, run npm run test to testing native addon. You can also switch to another testing framework if you want.

Develop requirements

  • Install latest Rust
  • Install Node.js@10+ which fully supported Node-API
  • Install [email protected]

Test in local

  • yarn
  • yarn build
  • yarn test

And you will see:

$ ava --verbose

  ✔ sync function from native code
  ✔ sleep function from native code (201ms)
  ─

  2 tests passed
✨  Done in 1.12s.

Release package

npm version [xxx]

git push --follow-tags

GitHub actions will do the rest job for you.

License

MPLv2.0

resvg-js's People

Contributors

dependabot[bot] avatar yisibl avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.