Socket
Book a DemoInstallSign in
Socket

@gomander/napi-gif-encoder

Package Overview
Dependencies
Maintainers
0
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@gomander/napi-gif-encoder

A faster GIF Encoder for Node JS using Rust

0.0.8
latest
Source
npmnpm
Version published
Weekly downloads
0
Maintainers
0
Weekly downloads
 
Created
Source

napi-gif-encoder

https://github.com/gomander/napi-gif-encoder/actions

A faster GIF Encoder for Node JS using Rust

This library is a fork of @tyrone-sudeium/napi-gif-encoder.
I made this fork because the original is not currently being maintained, and I needed a new feature added.

Install

npm install @gomander/napi-gif-encoder

Support matrix

Operating Systems

Linux x64/aarch64Windows x64

NodeJS

Theoretically, any version of Node that supports N-API should work. The CI is validated against LTS versions of Node:

Node 18Node 20Node 22

Building

If you are using this as a dependency, since we use N-API, you don't need to build anything! However, if you want to tinker with this code or submit a PR, read below.

Developing

  • Install latest Rust. Suggest using rustup. If on Windows, use WSL for an easier time.
  • Install NodeJS@18+. LTS versions suggested.
  • Install yarn@1.x.
  • Install dependencies with yarn.

You can then compile the rust code with yarn build.

After running yarn build, you will see a napi-gif-encoder.<PLATFORM>.node file in the project root. This is the native addon built from lib.rs.

Try out using sample project

  • yarn
  • yarn build
  • cd sample
  • yarn
  • node .

You'll then see output.gif, which was encoded using the rust encoder.

You can compare this to a Node-based GIF encoder by running node . --js.

Performance

This data is a ten-run average of the time it took to encode the sample project on a Ryzen 7 7800X3D.
Historical data from the original author also suggests that this library scales better with more cores than Node-based GIF encoders.

EncoderTime
gif-encoder-2692ms
napi-gif-encoder250ms

Keywords

napi-rs

FAQs

Package last updated on 25 Nov 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.