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

dsa-shipshape

v0.1.2

Published

TypeScript utilities for parsing, editing, and encoding Deep Space Airships blueprints for drednot.io.

Readme

dsa-shipshape

shipshape is a TypeScript library for parsing, editing, and encoding Deep Space Airships (drednot.io) blueprint strings.

Use this package when you want to read an existing DSA blueprint, generate a new one, or make programmatic edits without handling the compressed binary blueprint format yourself.

Install

npm install dsa-shipshape

Or load the browser bundle directly from a CDN:

<script src="https://cdn.jsdelivr.net/npm/dsa-shipshape/dist/browser/dsa-shipshape.global.js"></script>
<script>
  const ship = new DSAShipshape.Structure(12, 8); // Create an empty 12x8 structure.
  ship.place(DSAShipshape.Item.IRON_BLOCK, 4, 3); // Place one iron block.

  const blueprint = ship.toBlueprint(); // Compact placements into blueprint commands.
  const code = DSAShipshape.Blueprint.encode(blueprint, { prefix: true }); // Encode for DSA.

  console.log(code); // Print the encoded string.
</script>

Quick Start

Create a small blueprint and encode it back to a DSA string:

import {
  Blueprint, // Encode and decode DSA blueprint strings.
  Item, // Known DSA item IDs.
  Shape, // Known DSA block shape IDs.
  Structure // Editable ship model.
} from "dsa-shipshape";

const ship = new Structure(12, 8); // Create an empty 12x8 structure.

ship.place(Item.CARGO_HATCH_PACKAGED, 2, 3); // Place a cargo hatch at x=2, y=3.
ship.place(Item.IRON_BLOCK, 4, 3); // Place a full iron block at x=4, y=3.
ship.place(Item.IRON_BLOCK, 5, 3, {
  shape: Shape.Ramp.TopLeft // Give this iron block a non-default shape.
});

const blueprint = ship.toBlueprint(); // Compact placements into blueprint commands.
const code = Blueprint.encode(blueprint, { prefix: true }); // Encode to a base64 string with the DSA: prefix.

console.log(code); // Print the encoded string.

Decode, edit, and re-encode an existing blueprint:

import {
  AdjacentPosition, // Loader input/output position constants.
  Blueprint, // Encode and decode DSA blueprint strings.
  Item, // Known DSA item IDs.
  Priority, // Item configuration priority constants.
  Structure, // Editable ship model.
  loaderConfig // Helper for loader configuration objects.
} from "dsa-shipshape";

const blueprint = Blueprint.decode(inputCode); // Parse a raw or DSA:-prefixed string.
const ship = Structure.fromBlueprint(blueprint); // Expand commands into editable placements.

const loaderId = ship.place(Item.LOADER_PACKAGED, 5, 5); // Add a loader and keep its editing ID.
ship.config(loaderId, [
  loaderConfig({
    pickPosition: AdjacentPosition.LEFT_MIDDLE, // Pick up from the tile to the left.
    placePosition: AdjacentPosition.RIGHT_MIDDLE, // Place onto the tile to the right.
    priority: Priority.NORMAL // Use the default priority.
  })
]);
ship.place(Item.IRON_BLOCK, 6, 5); // Add another placement to the structure.

const outputBlueprint = ship.toBlueprint(); // Rebuild to a Blueprint (command representation).
const outputCode = Blueprint.encode(outputBlueprint, { prefix: true }); // Encode

Further docs are available in the API Guide.

Dev Setup

npm install # Install dependencies
npm run typecheck # Check for type errors
npm test # Run tests
npm run build # Build

Shortcuts are available with just:

just check # Run typecheck and tests
just build # Build package outputs
just pack # Preview the npm package contents