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

@redtact/deepslate-extras

v0.3.0

Published

Extras for deepslate structure viewers: bit-identical performance patches, fade rendering, structure splitting, raycasting, and a dirty-flag render loop.

Downloads

550

Readme

@redtact/deepslate-extras

Extras for deepslate structure viewers:

Not affiliated with the deepslate project. This is an independent, community-maintained package that builds on deepslate (MIT, © Misode) and is neither endorsed by nor associated with it.

  • applyDeepslatePatches — runtime prototype patches for deepslate 0.25.1 (bit-identical output, 2-3x faster mesh builds, Uint32 index buffers, location caching, optional CPU-side quad release after GPU upload, optional block-count-independent partial chunk updates)
  • FadeStructureRenderer — draw the unselected part of a structure translucent and desaturated, with selection boxes / hover / drag-preview line meshes
  • splitStructure / splitStructureCropped / filterStructureByY — split a structure by region, material, or picked positions without shifting coordinates
  • IncrementalSplitView — keep the split structures up to date in place and re-mesh only the affected chunks, so toggling one picked block costs tens of milliseconds instead of a full re-mesh (1773 ms → 52 ms at 131k blocks)
  • ddaRaycast / cameraRayFromMouse / rayToStructureEntry — block picking
  • createRenderLoop — dirty-flag requestAnimationFrame loop that fully stops when idle
  • getSliceRange, getBlockFlags, padTextureBlobs helpers

deepslate (^0.25.1) is a peer dependency. Node.js >= 20.19 (or >= 22.12 on the 22.x line) is required for the CJS entry (require(esm) support, since deepslate is ESM-only).

See the repository README for usage examples.

Incremental chunk updates

import { applyDeepslatePatches, IncrementalSplitView } from "@redtact/deepslate-extras";

applyDeepslatePatches({ fastPartialChunkUpdate: true });

const view = new IncrementalSplitView(
  structure,
  { specs, crop: null, slice: null },
  { inner: structureRenderer, outer: fadeRenderer },
  { chunkSize: 16 }, // must match both renderers' ChunkBuilder chunk size
);

// `next` is the state AFTER this toggle is applied.
const next = { specs: specsWithPositions(nextPositions), crop, slice };
const result = view.toggle(["3,4,5"], true, next);
if (result.status === "needs-resplit") view.resplit(next); // view was left untouched
loop.invalidate(); // toggle updates GPU buffers only; it does not request a redraw

Four things to get right:

  1. inputs is the state after the toggle. The view checks both the structural signature (specs/crop/slice) and the resulting picked-position set against its own state, and refuses the diff on a mismatch rather than leaving stale blocks selected.
  2. needs-resplit means the view is unchanged — call resplit(inputs) exactly once. It never resplits internally, so a full rebuild never runs twice. Going from 0 picked blocks to 1 (or 1 to 0) always lands here, because splitStructure ignores region/materials while positions is non-empty.
  3. chunkSize must match across IncrementalSplitView, StructureRenderer and FadeStructureRenderer. A mismatch is thrown at construction when the renderer exposes chunkSize (FadeStructureRenderer does).
  4. Block order affects translucent blending. deepslate draws a chunk's quads in merge order, with BLEND on (and depthMask(false) in the fade renderer), so order changes the pixels for glass/water/ice and for the whole faded layer. The split helpers normalise to ascending flat index and the partial update scans in the same order, so both paths match. For a structure that did not come from those helpers, call sortStructureBlocks(structure) once first.

toggle returns { status: "applied" | "noop" | "needs-resplit", chunks, moved, skipped }. Pass all keys of a drag selection in one call — calling it per block bypasses fullRebuildChunkThreshold and re-meshes ~7 chunks every time.

License

Apache-2.0. Contains code derived from deepslate (MIT) — see NOTICE.