npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

react-native-nitro-vector

v0.0.1

Published

High-performance vector path engine for React Native, powered by Nitro Modules

Readme

react-native-nitro-vector

react-native-nitro-vector is a C++ vector path engine for React Native, powered by Nitro Modules.

SVG Path Playground Built from scratch — bezier math, boolean operations, path analysis, and SVG parsing — all running in C++ off the JS thread entirely.

Benchmark

Parsing 1,000 SVG paths on Android:

| Parser | Total | Per parse | | ------------------------- | ----- | --------- | | react-native-nitro-vector | 4.2ms | 4.2μs | | svg-path-parser (JS) | 443ms | 443μs |

104x faster than the popular JS alternative.

Installation

npm install react-native-nitro-vector

Requires Nitro Modules to be installed in your project.

This is not a renderer — it is a geometry computation engine used to prepare vector data for rendering systems.

Usage

import { vectorEngine } from 'react-native-nitro-vector'

// Parse an SVG path string
const path = vectorEngine.parseSvgPath(
  'M140 20C73 20 20 74 20 140c0 135 136 170 228 303 88-132 229-173 229-303 0-66-54-120-120-120-48 0-90 28-109 69-19-41-60-69-108-69z'
)

// Analyze it
console.log(path.toSvgString()) // normalized SVG string
console.log(path.getLength()) // arc length in coordinate units
console.log(path.getBounds()) // { x, y, width, height }
console.log(path.getArea()) // enclosed area
console.log(path.pointCount()) // number of anchor points

// Build a path manually
const manual = vectorEngine.createPath()
manual.moveTo({ x: 0, y: 0 })
manual.lineTo({ x: 100, y: 0 })
manual.curveTo({ x: 100, y: 50 }, { x: 50, y: 100 }, { x: 0, y: 100 })
manual.close()
console.log(manual.toSvgString())

API

VectorEngine

| Method | Returns | Description | | ----------------- | ------------ | -------------------------------------------- | | createPath() | HybridPath | Creates a new empty path | | parseSvgPath(d) | HybridPath | Parses an SVG path string into a path object |

HybridPath

Construction

| Method | Returns | Description | | -------------------------- | ------- | --------------------------------------- | | moveTo(point) | void | Starts a new subpath at the given point | | lineTo(point) | void | Adds a straight line to the given point | | curveTo(cp1, cp2, point) | void | Adds a cubic bezier curve | | close() | void | Closes the current subpath |

Analysis

| Method | Returns | Description | | --------------- | -------- | ----------------------------------------- | | toSvgString() | string | Serializes the path to an SVG path string | | getLength() | number | Total arc length of the path | | getBounds() | Rect | Axis-aligned bounding box | | getArea() | number | Enclosed area of the path | | pointCount() | number | Total number of anchor points |

What's Coming

The C++ engine underneath already supports these — JS bindings being added as projects need them:

  • Boolean operations — union, subtract, intersect, XOR
  • Path offsetting — stroke and offset paths
  • Closest point — hit testing and snapping
  • Arc length parameterization — equal spacing along curves
  • Path simplification — Ramer-Douglas-Peucker
  • Affine transforms — translate, rotate, scale, skew

How It Works

The engine is a pure C++ vector path library with no external dependencies. It implements:

  • Cubic bezier evaluation, splitting, and flattening
  • Arc length via 5-point Gaussian quadrature
  • Newton-Raphson for arc length inversion
  • Winding number algorithm for point-in-path testing
  • SVG path parser supporting M, L, C, Q, A, T, S, Z and relative commands
  • Boolean operations via segment labeling and assembly

Wrapped with Nitro Modules for type-safe, zero-boilerplate JSI bindings.

Source

  • Nitro package: this repository
  • C++ engine: originally developed at jsi-canvas, vendored into cpp/vector-engine

License

MIT