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

@4ndr3.dk/mophree-engine

v0.2.6

Published

Framework-free three.js engine — procedural, photoreal iPhone/iPad device models with a camera rig, keyframe/easing timeline, and video export. Developed during the Config Makeathon 2026 as the 3D engine behind the mophree Figma Make project.

Downloads

1,398

Readme

mophree-engine

Framework-free three.js engine — procedural, photoreal iPhone / iPad device models with a camera rig, a keyframe + cubic-bezier easing timeline, and real-time video export (WebM / MP4, with alpha).

This package was developed during the Config Makeathon 2026 as the 3D engine behind the mophree Figma Make project. The editor UI is built in Figma Make; this package is the rendering/animation core it imports — the way you'd pull in any library. Every module imports only three, with no app framework, no build step, and no binary 3D assets (the device geometry is generated in code from Apple's published dimensional drawings).

Install

npm install @4ndr3.dk/mophree-engine three

three is a peer dependency on purpose: the host app and this package must resolve to a single three instance. scene.js patches the global THREE.ShaderChunk (to add distance-based PCSS contact shadows) and relies on shared three internals — two copies would silently break shadows and instanceof checks. Pinned to the 0.180.x line the engine was built against.

Usage

import { createStage, createRig, createIphone17, TL } from '@4ndr3.dk/mophree-engine';

const stage = createStage(document.getElementById('viewport')); // appends a <canvas>
const rig = createRig(stage.camera, stage.renderer.domElement);

const device = createIphone17();
stage.scene.add(device.group);
rig.setDefaults(device.camDefaults, true);

stage.setSize(1280, 720); // letterbox to taste

// choreograph a camera move
const tl = TL.createTimeline({ duration: 6, preset: 'orbit' });
TL.regeneratePreset(tl, device.camDefaults);

let t = 0, last = performance.now();
function frame(now) {
  requestAnimationFrame(frame);
  t = (t + (now - last) / 1000) % tl.duration; last = now;
  const pose = TL.evaluate(tl, t);
  if (pose) rig.setPose(pose, true);
  rig.update(1 / 60);
  stage.render();
}
requestAnimationFrame(frame);

React adapter (/react)

In React (e.g. a Figma Make project), import the headless useMophree hook from the /react subpath instead of wiring the engine by hand. It owns the stage/rig/devices/timeline and the render loop and returns { hostRef, state, actions } — attach hostRef to a div, build your UI against actions/state:

import { useMophree, SCENES, ASPECTS } from '@4ndr3.dk/mophree-engine/react';

export default function Editor() {
  const { hostRef, state, actions } = useMophree();
  return (
    <>
      <button onClick={() => actions.toggle()}>{state.playing ? 'Pause' : 'Play'}</button>
      <div ref={hostRef} style={{ width: '100%', height: 480 }} />
    </>
  );
}

react is an optional peer dependency — needed only if you import /react. The core entry (.) stays framework-free (three.js only).

API

  • createStage(el){ renderer, scene, camera, setSize(w,h), render(), setScene(name), setAmbient(hex), getScene() }. Scenes: color | black | white | transparent. Importing this applies the PCSS shader patch once.
  • createRig(camera, domElement){ setPose, setDefaults, update, getTarget, getCurrent, getTargetY, isDragging, onUserChange, dispose } — orbit camera (yaw/pitch/dist) with damping + drag/wheel input.
  • createIphone17() / createIpad() → device contract { id, label, group, baseY, bob, screen:{mesh,w,h,defaultMat}, camDefaults:{dist,targetY,pitch}, finishes:[{name,hex}], setFinish(hex) }.
  • TL (namespace, pure data) — createTimeline, addKeyframe, moveKeyframe, removeKeyframe, getKeyframe, evaluate, setKeyframeEasing, setKeyframeBezier, setDuration, adoptVideoDuration, regeneratePreset, defaultTabs, bezierEase, EASINGS, PRESETS, ….
  • Media (namespace) — loadVideoBlob, applyToScreen, createWallpaperMaterial, coverFit, makeTestClip, … (video → VideoTexture, with the Infinity-duration fix and cover-fit).
  • exportVideo({ canvas, duration, format, prepare, tick, restore, onProgress }), FORMATS, supportedFormats(), resolveMime(), downloadBlob() — real-time captureStream + MediaRecorder capture; WebM preserves alpha.
  • DEFAULT_AMBIENT — the default ambient tint hex.

Attribution

  • Built on three.js (MIT).
  • Device geometry is reconstructed from Apple's published dimensional drawings used as geometric reference only — no Apple assets are included or distributed.

License

MIT — see LICENSE.