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

@lightspeed/crane-api

v1.1.1

Published

Lightweight runtime API package for building custom sections and templates with `@lightspeed/crane`.

Readme

@lightspeed/crane-api

Lightweight runtime API package for building custom sections and templates with @lightspeed/crane.

This package provides Vue 3 composables and TypeScript types needed for custom sections and templates, without CLI or build tools.

Installation

npm install @lightspeed/crane-api

Note: This package is automatically included when using @lightspeed/crane. Install separately only if you need the API without the CLI.

Overview

The package exports:

  • App CreationcreateVueServerApp, createVueClientApp for SSR/hydration
  • Content Composables — Access user-editable content (text, images, buttons, etc.)
  • Design Composables — Access styling settings (colors, fonts, backgrounds)
  • Types — TypeScript definitions for data structures

App Entry Points

Every section requires two entry points for SSR and client hydration:

// server.ts — SSR rendering
import { createVueServerApp } from '@lightspeed/crane-api';
import Section from './Section.vue';
import type { ContentType, DesignType } from './type';

export default createVueServerApp<ContentType, DesignType>(Section);
// client.ts — Client hydration
import { createVueClientApp } from '@lightspeed/crane-api';
import Section from './Section.vue';
import type { ContentType, DesignType } from './type';

export default createVueClientApp<ContentType, DesignType>(Section);

Content Composables

Access content defined in settings/content.ts:

| Composable | Editor Type | Return Type | |------------|-------------|-------------| | useInputboxElementContent | INPUTBOX | Reactive<InputBoxContent> | | useTextareaElementContent | TEXTAREA | Reactive<TextAreaContent> | | useButtonElementContent | BUTTON | Reactive<ButtonContentData> | | useImageElementContent | IMAGE | Reactive<ImageContent> | | useToggleElementContent | TOGGLE | Reactive<ToggleContent> | | useSelectboxElementContent | SELECTBOX | Reactive<SelectBoxContent> | | useDeckElementContent | DECK | Reactive<DeckContent> | | useCategorySelectorElementContent | CATEGORY_SELECTOR | Reactive<CategorySelector> | | useProductSelectorElementContent | PRODUCT_SELECTOR | Reactive<ProductSelector> | | useLogoElementContent | LOGO | Reactive<LogoContent> | | useMenuElementContent | MENU | Reactive<MenuContent> | | useNavigationMenuElementContent | NAVIGATION_MENU | Reactive<MenuContent> | | useTranslation | — | Translation helper |

Example

import { useInputboxElementContent, useImageElementContent } from '@lightspeed/crane-api';
import type { ContentType } from './type';

const title = useInputboxElementContent<ContentType>('title');
const image = useImageElementContent<ContentType>('hero_image');

Design Composables

Access design settings defined in settings/design.ts:

| Composable | Editor Type | Return Type | |------------|-------------|-------------| | useTextElementDesign | TEXT | Reactive<TextDesignData> | | useTextareaElementDesign | TEXTAREA | Reactive<TextareaDesignData> | | useButtonElementDesign | BUTTON | Reactive<ButtonDesignData> | | useBackgroundElementDesign | BACKGROUND | Reactive<BackgroundDesignData> | | useImageElementDesign | IMAGE | Reactive<ImageDesignData> | | useToggleElementDesign | TOGGLE | Reactive<ToggleDesignData> | | useSelectboxElementDesign | SELECTBOX | Reactive<SelectboxDesignData> | | useLayoutElementDesign | — | Reactive<LayoutDesignData> | | useLogoElementDesign | LOGO | ComputedRef<LogoDesignData> |

Example

import { useTextElementDesign, useBackgroundElementDesign } from '@lightspeed/crane-api';
import type { DesignType } from './type';

const titleStyle = useTextElementDesign<DesignType>('title_style');
const background = useBackgroundElementDesign<DesignType>('section_background');

Working with DECK

DECK allows collections of cards. Use getReactiveRef to access card fields:

import { useDeckElementContent, EditorTypes } from '@lightspeed/crane-api';
import type { ContentType } from './type';

const slides = useDeckElementContent<ContentType>('slides');

slides.cards?.forEach(card => {
  const title = slides.getReactiveRef(card, EditorTypes.INPUTBOX, 'title');
  const image = slides.getReactiveRef(card, EditorTypes.IMAGE, 'background');
  const button = slides.getReactiveRef(card, EditorTypes.BUTTON, 'cta');
});

Requirements

  • Node.js >= 20
  • Vue >= 3.4