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

@connected-web/terrain-editor

v0.1.5

Published

Reusable viewer/editor utilities for Wyn terrain files.

Readme

@connected-web/terrain-editor

A TypeScript library for loading, viewing, and editing .wyn terrain files in the browser using Three.js.

Installation

npm install @connected-web/terrain-editor three

What are .wyn files?

.wyn files are compressed archives containing terrain data with the following structure:

  • legend.json: Metadata about the terrain (layers, name, author, description)
  • layers/*.png: Terrain layers (heightmap, colormap, normalmap, etc.)
  • locations.json: Predefined camera locations and points of interest
  • theme.json: Visual theme for markers and UI elements
  • thumbnails/thumbnail.png: Preview thumbnail

Usage

Loading a Wyn Archive

import { loadWynArchive } from '@connected-web/terrain-editor'

const archive = await loadWynArchive('/path/to/terrain.wyn')

console.log(archive.legend)      // Terrain metadata
console.log(archive.layers)      // Layer image data
console.log(archive.locations)   // Points of interest
console.log(archive.theme)       // Visual theme

Creating a Terrain Viewer

import { TerrainViewer } from '@connected-web/terrain-editor'
import * as THREE from 'three'

const viewer = new TerrainViewer({
  container: document.getElementById('viewer'),
  archive: archive,
  onLocationClick: (location) => {
    console.log('Clicked:', location.label)
  }
})

// Start rendering
viewer.start()

// Clean up when done
viewer.dispose()

Geometry Utilities

import {
  createHeightSampler,
  sampleHeightValue,
  applyHeightField
} from '@connected-web/terrain-editor'

// Sample height values from a texture
const sampler = createHeightSampler(heightTexture)
const height = sampleHeightValue(sampler, u, v)

// Apply heightfield to plane geometry
const geometry = new THREE.PlaneGeometry(100, 100, 256, 256)
applyHeightField(geometry, sampler, {
  seaLevel: 0.3,
  heightScale: 20
})

Editor Features

For building and editing terrain archives:

import {
  ProjectStore,
  buildWynArchive
} from '@connected-web/terrain-editor'

// Create a new project
const project = new ProjectStore()
project.setLegend({
  name: 'My Terrain',
  description: 'Custom terrain map',
  layers: [
    { name: 'heightmap', type: 'height' },
    { name: 'colormap', type: 'color' }
  ]
})

// Build archive
const blob = await buildWynArchive(project)

API Reference

Core Modules

  • loadWynArchive: Load and parse .wyn files
  • TerrainViewer: Complete 3D terrain viewer with controls
  • ViewerHost: Lower-level scene/camera management
  • ViewerOverlay: UI overlay for locations and markers

Geometry

  • createHeightSampler: Sample height data from textures
  • applyHeightField: Apply height displacement to geometry
  • buildRimMesh: Generate terrain edge geometry

Editor

  • ProjectStore: State management for terrain editing
  • buildWynArchive: Package terrain data into .wyn format
  • LayerBrowser: Layer management utilities
  • MaskToolkit: Layer masking and blending

Theming

  • MarkerSpriteTheme: Customize location marker appearance
  • MarkerStemTheme: Customize marker stems (3D poles)

Examples

See the full demos:

Requirements

  • Three.js ^0.181.1
  • Modern browser with WebGL support

License

ISC

Repository

https://github.com/connected-web/terrain-editor