wolfdev-rn-sticker-api
v1.0.2
Published
Convert images and videos to WebP stickers - utility functions for React Native
Downloads
8
Maintainers
Readme
WOLFDEV — wolfdev-rn-sticker-api
A small, super-rad WebSocket sticker converter by WOLFDEV — converts images/videos to WebP stickers (exportable module or standalone WebSocket server).
Features
- Image -> WebP sticker (512x512, transparent background)
- Video -> animated WebP sticker (trim to max 10s)
- Programmatic module export + simple WebSocket server starter
Prerequisites
- Node.js >= 18
- ffmpeg installed and available in PATH (required by fluent-ffmpeg)
- On some systems sharp needs build deps — see sharp docs if install errors occur
Install npm install wolfdev-rn-sticker-api
Or for local development: npm install (then run server or test scripts in this repo)
Quick start (programmatic) import { createWebSocketServer } from 'wolfdev-rn-sticker-api';
const wss = createWebSocketServer({ port: 3000 }); // Clients connect to ws://host:3000 and send JSON: // { "type": "image" | "video", "buffer": <Array | base64-string> } // Server responds with { success: true, sticker: "" }
API
- createWebSocketServer(options = { port }) -> WebSocketServer
- createImageSticker(imageBuffer: Buffer) -> Promise
- createVideoSticker(videoBuffer: Buffer) -> Promise
Testing locally (repo)
- Ensure sample.jpg and sample.mp4 are placed in src/
- Start server: node src/server.js
- Run test client: node src/test.js Output .webp files will be saved in src/ as output_.webp
Packaging / Publishing notes
- main entry: src/index.js
- remove node_modules and package-lock before publishing
- ensure package.json.name = "wolfdev-rn-sticker-api"
- consumers must have ffmpeg in PATH
Author WOLFDEV
License MIT
