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

@flightdev/cms

v0.2.1

Published

Unified CMS adapters for Flight Framework - use any headless CMS

Readme

@flightdev/cms

Unified CMS adapters for Flight Framework. One API for Strapi, Contentful, Sanity, and more.

Philosophy

Flight doesn't impose - you choose your CMS. All adapters are optional, swap providers without changing your code.

Features

  • Adapter pattern - Same API for any CMS
  • Zero lock-in - Switch CMS providers without code changes
  • React hooks - useCMSQuery, useCMSOne, mutations
  • Vue composables - Reactive queries with auto-refetch
  • Full CRUD - Read, create, update, delete
  • i18n support - Locale-aware queries
  • Preview mode - Draft content for editors

Installation

npm install @flightdev/cms

Quick Start

import { createCMS } from '@flightdev/cms';
import { strapi } from '@flightdev/cms/strapi';

const cms = createCMS(strapi({
    url: process.env.STRAPI_URL,
    token: process.env.STRAPI_TOKEN,
}));

// Query posts
const { data: posts, meta } = await cms.findMany('posts', {
    limit: 10,
    sort: { publishedAt: 'desc' },
    populate: ['author', 'cover'],
});

// Get single post
const post = await cms.findOne('posts', {
    where: { slug: 'hello-world' },
});

Adapters

Strapi

import { strapi } from '@flightdev/cms/strapi';

const adapter = strapi({
    url: 'http://localhost:1337',
    token: 'your-api-token',
    preview: true, // Enable draft mode
});

Contentful

import { contentful } from '@flightdev/cms/contentful';

const adapter = contentful({
    spaceId: 'your-space-id',
    accessToken: 'your-access-token',
    environment: 'master',
    preview: true,
    previewToken: 'preview-token',
});

Sanity

import { sanity } from '@flightdev/cms/sanity';

const adapter = sanity({
    projectId: 'your-project-id',
    dataset: 'production',
    token: 'your-token', // Optional for public datasets
    useCdn: true,
});

React Integration

import { CMSProvider, useCMSQuery, useCMSOne } from '@flightdev/cms/react';

// App
function App() {
    return (
        <CMSProvider cms={cms}>
            <PostList />
        </CMSProvider>
    );
}

// Query many
function PostList() {
    const { data: posts, loading, meta, refetch } = useCMSQuery('posts', {
        limit: 10,
        populate: ['author'],
    });
    
    if (loading) return <Skeleton />;
    
    return (
        <>
            {posts.map(post => <PostCard key={post.id} post={post} />)}
            <p>Total: {meta?.total}</p>
        </>
    );
}

// Query one
function PostPage({ slug }) {
    const { data: post, loading, error } = useCMSOne('posts', {
        where: { slug },
    });
    
    if (loading) return <Skeleton />;
    if (!post) return <NotFound />;
    
    return <Post post={post} />;
}

Vue Integration

<script setup>
import { provideCMS, useCMSQuery } from '@flightdev/cms/vue';

// Provide CMS in root component
provideCMS(cms);

// Query posts
const { data: posts, loading, meta } = useCMSQuery('posts', {
    limit: 10,
    sort: { publishedAt: 'desc' },
});
</script>

<template>
    <div v-if="loading">Loading...</div>
    <PostGrid v-else :posts="posts" />
</template>

API Reference

Query Options

interface FindManyOptions {
    where?: Record<string, unknown>;   // Filter conditions
    populate?: string[];               // Relations to include
    limit?: number;                    // Max results
    offset?: number;                   // Skip results
    page?: number;                     // Page number
    pageSize?: number;                 // Items per page
    sort?: Record<string, 'asc' | 'desc'>; // Sort order
    fields?: string[];                 // Select fields
    locale?: string;                   // Content locale
    preview?: boolean;                 // Draft mode
}

CMS Methods

| Method | Description | |--------|-------------| | findOne(collection, options) | Get single entity | | findMany(collection, options) | Get multiple with pagination | | findById(collection, id, options) | Get by ID | | create(collection, data) | Create entity | | update(collection, id, data) | Update entity | | delete(collection, id) | Delete entity |

License

MIT