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 🙏

© 2024 – Pkg Stats / Ryan Hefner

mapserver-wasm

v2.2.0

Published

WebAssembly version of MapServer with a dispatchRequest interface

Downloads

25

Readme

mapserver-wasm

Features

  • Use MapServer inside your browser
  • Expose WFS 2.0.0 and WMS 1.3.0 services
  • Read vector and raster data from GeoPackage

ThirdParty Dependencies

|Name|Version|Home page|License|Status| |----|-------|---------|-------|-------| |MapServer|8.2.2|https://mapserver.org/|MIT|✅| |GDAL/OGR|3.9.2|https://gdal.org/|MIT/X style|✅| |PROJ|9.5.0|https://proj.org/|MIT/X style|✅| |GEOS|3.13.0|https://libgeos.org/|LGPL-2.1|✅| |SQLite|3.46.1|https://www.sqlite.org/|Public Domain|✅| |Libxml2|2.13.4|http://xmlsoft.org/|MIT|✅|

✅ up-to-date | 🚧 needs-update | Last update check 24.09.2024

Getting started

Installation

To download mapserver-wasm run:

npm install mapserver-wasm
# or
yarn add mapserver-wasm

Usage

import MapServer from 'mapserver-wasm'

MapServer().then(async Module => {
  const WORKERFS = Module.FS.filesystems['WORKERFS']
  const MEMFS = Module.FS.filesystems['MEMFS']

  Module.FS.mkdir('/ms')
  Module.FS.mkdir('/proj')

  try {
    WORKERFS.node_ops.mknod = MEMFS.node_ops.mknod // GDAL needs temporary file support
    Module.FS.mount(WORKERFS, {
      blobs: [
        { name: 'test.gpkg', data: /* gpkg blob */ }
      ]
    }, '/ms')
    Module.FS.writeFile('/proj/epsg', crsDefinitions.map(({ crs, definition }) => {
      return `<${crs.replace('EPSG:', '')}>${definition}<>`
    }).join('\n'), { flags: 'w+' })
    // ...
    resolve()
  } catch (e) {
    reject(e)
  }
})

Please look into the demo project or into the test folder for further information.

Development

Required Web APIs

WebAssembly 1.0 | WebAssembly Exception Handling

Checkout

git clone --recurse-submodules [email protected]:codeart1st/mapserver-wasm.git
git clone [email protected]:codeart1st/mapserver-wasm.git
git submodule update --init --recursive

Update

git pull --recurse-submodules

Compilation

Start the build container with the following command to ensure the filesystem permissions for newly created files are correct.

docker run -it --rm -v $(pwd):/src -v /etc/passwd:/etc/passwd --user "$(id -u):$(id -g)" --name mapserver-wasm emscripten/emsdk:3.1.67 bash

And execute in a second terminal the following command to install the missing build depedencies as root user.

docker exec --user root mapserver-wasm bash -c "apt-get update && DEBIAN_FRONTEND=noninteractive apt-get install -y tcl automake pkgconf libtool brotli"

After that execute all job script commands described in .github/workflows/ci.yml inside the interactive build container. It can be helpful to set the GITHUB_WORKSPACE environment variable beforehand.

GITHUB_WORKSPACE=/src

Test

Tests will be executed with Vitest framework. Test execution needs compilation of mapserver-wasm first.

npm ci && npm test

Logging

To avoid debugging in first place it can be helpful to activate file logging for MapServer and GDAL.

MAP
  DEBUG 5
  CONFIG "MS_ERRORFILE" "error.log"
  CONFIG "CPL_LOG" "error.log"
  CONFIG "CPL_DEBUG" "ON"
  CONFIG "CPL_LOG_ERRORS" "ON"
  CONFIG "CPL_TIMESTAMP" "ON"
END

Debugging

Debugging in DWARF format has initial support in Chrome.