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

mars-globe

v1.0.2

Published

Drop-in 3D Mars globe for CesiumJS — Mars ellipsoid, NASA Mars Trek basemaps, geographic tiling, no Ion token. NPM package, <mars-globe> Web Component, and CesiumJS plugin.

Readme

mars-globe

A drop-in 3D Mars globe for CesiumJS — the Mars ellipsoid, NASA Mars Trek basemaps, and the correct geographic tiling, configured for you. No Cesium Ion token required.

Live demo and docs → aaron43210.github.io/mars-globe

Setting Cesium up for Mars (overriding the ellipsoid to 3,396 km × 3,376 km, removing Earth atmosphere/skybox/geocoder, and wiring the NASA Trek tile scheme) is fiddly and poorly documented. This package does it in one line, three ways: an NPM module, a <mars-globe> Web Component, and a CesiumJS plugin.

Extracted from the open-source MarsGIS project, where it powers the live Mars map.

Install

npm install mars-globe cesium

cesium is a peer dependency (not bundled) — install the Cesium version your app uses. Cesium also needs its static assets available: set window.CESIUM_BASE_URL and load cesium/Build/Cesium/Widgets/widgets.css (standard Cesium setup; your bundler plugin or a copy step handles this).

Use it (3 ways)

1. NPM module — React / Vue / Svelte / plain JS

import { createMarsGlobe } from 'mars-globe';

const globe = createMarsGlobe(document.getElementById('map'), {
  defaultBasemap: 'viking', // 'viking' | 'mola' | 'mola-dem' | 'themis'
});

globe.setBasemap('mola');      // switch basemap at runtime
globe.viewer;                  // the underlying Cesium Viewer (full API)
globe.destroy();               // tear down + free the WebGL context

2. Web Component — any HTML page

<script type="module">
  import { defineMarsGlobe } from 'mars-globe';
  defineMarsGlobe();
</script>

<mars-globe basemap="viking" style="display:block; width:100vw; height:100vh;"></mars-globe>

Or with the standalone build + a plain script tag (Cesium loaded first):

<link rel="stylesheet" href="https://cdn.jsdelivr.net/npm/[email protected]/Build/Cesium/Widgets/widgets.css" />
<script>window.CESIUM_BASE_URL = 'https://cdn.jsdelivr.net/npm/[email protected]/Build/Cesium/';</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/Build/Cesium/Cesium.js"></script>
<script src="https://cdn.jsdelivr.net/npm/mars-globe@1/dist/mars-globe.min.js"></script>

<mars-globe basemap="mola" style="display:block; width:100vw; height:100vh;"></mars-globe>

3. CesiumJS plugin — an existing Viewer

import { Viewer } from 'cesium';
import { installMarsEllipsoid, setupMarsGlobe } from 'mars-globe';

installMarsEllipsoid();                 // MUST run before the Viewer is created
const viewer = new Viewer('cesiumContainer');
setupMarsGlobe(viewer, { basemap: 'viking' });

Basemaps

| id | layer | |----|-------| | viking | Viking MDIM 2.1 color mosaic (232 m) | | mola | MOLA color shaded relief (463 m) | | mola-dem | MOLA elevation, grayscale with brighter = higher (visual, 463 m) | | themis | THEMIS day IR (100 m) |

All are the global equirectangular NASA Trek grid (2×1 tiles at level 0), served live from trek.nasa.gov.

API

  • createMarsGlobe(container, options?) => MarsGlobe — { defaultBasemap?, keepStars?, viewerOptions? }.
  • MarsGlobe — .viewer, .basemap, .setBasemap(id), .destroy().
  • setupMarsGlobe(viewer, { basemap?, keepStars? }) — configure an existing Viewer.
  • installMarsEllipsoid() / isMarsEllipsoidInstalled().
  • marsViewerOptions(overrides?), applyMarsScene(viewer, { keepStars? }).
  • basemapProvider(id), basemapUrl(id), BASEMAPS.
  • defineMarsGlobe(tagName?), MarsGlobeElement.
  • MARS_RADII, VERSION.

Notes

  • requestRenderMode defaults off so async tile loads never leave the globe on a blank first frame. Pass viewerOptions: { requestRenderMode: true } if you drive scene.requestRender() yourself.
  • Safe to import during SSR / in Node (nothing touches the DOM until you create a globe or call defineMarsGlobe() in the browser).
  • Coordinates are Mars IAU 2000 degrees (east-positive longitude).
  • Imagery is NASA/JPL/USGS — Mars Trek, streamed live and not redistributed by this package.

Development

npm run build          # ESM + types + standalone IIFE into dist/
npm test               # unit tests against dist/
npm run test:browser   # headless Chrome, all 3 usage modes (needs network for Trek tiles)

License

MIT © AARON R