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

revas

v2.0.0

Published

Build Apps on Canvas, with React and Flexible CSS, inspired by react-canvas

Downloads

241

Readme

Requirements

  • React 19.x (peer dependency)

Install

$ pnpm add revas react@19

Usage

Render to a DOM

import React from 'react'
import {render, View, Text} from 'revas'

render(
  <View style={{ flex: 1 }}>
    <Text style={{ fontSize: 20 }}>Revas</Text>
  </View>,
  document.getElementById('container')
)

Edit purple-browser-h56ht

Render to a DOM rendered by React

import React from 'react'
import {render, View, Text} from 'revas'

export class Widget extends React.Component {
  componentDidMount() {
    this.app = render(
      <View style={{ flex: 1 }}>
        <Text style={{ fontSize: 20 }}>Revas</Text>
      </View>,
      document.getElementById('container'),
      this
    )
  }
  componentDidUpdate() {
    this.app.update()
  }
  componentWillUnmount() {
    this.app.unmount()
  }
  render() {
    return <div id="container" />
  }
}

Edit reverent-river-vbypp

Render to a custom canvas api

  • https://github.com/pinqy520/revas-wxgame-example
  • https://github.com/pinqy520/revas-bytegame-example

DEMO

Upgrading from v1.x to v2.x

Revas 2.0 is a major upgrade with breaking changes:

Breaking Changes

| Change | v1.x | v2.x | |--------|------|------| | React version | React 17.x | React 19.x (required) | | Layout engine | yoga-layout-wasm (async) | yoga-layout 3.x (sync) | | Module format | CJS + ESM | ESM-first with CJS fallback |

What You Need to Do

  1. Upgrade React to version 19.x:

    pnpm add react@19 react-dom@19
  2. Update imports (if using /common export):

    // No changes needed - API is the same
    import { View, Text } from 'revas'
    import { View, Text } from 'revas/common'

Layout Engine Changes

The layout engine has been upgraded from yoga-layout-wasm to yoga-layout 3.x:

  • For most users: No changes needed. The style API remains the same.
  • Performance: Layout calculation is now synchronous (no async initialization).
  • Bundle size: Slightly larger due to WASM being bundled differently.

Supported Flexbox properties (unchanged):

  • Layout: flex, flexDirection, justifyContent, alignItems, alignSelf, flexWrap
  • Sizing: width, height, minWidth, maxWidth, minHeight, maxHeight
  • Spacing: padding, margin, borderWidth
  • Positioning: position (relative, absolute, static), top, left, right, bottom

For full style reference, see style.ts.

For Custom Canvas Platforms

If you're using Revas on custom platforms (WeChat mini-games, ByteDance games), the revas/common export now uses synchronous yoga-layout. Remove any async initialization code:

// v1.x (old)
import { initYoga } from 'revas/common'
await initYoga()  // ❌ No longer needed

// v2.x (new)
import { render } from 'revas/common'
render(...)  // ✅ Works immediately

Other Framework