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

@bastards/bcs-data-localfs

v0.2.0

Published

Local filesystem implementation of the BCS CMS datalayer

Readme

@bastards/bcs-data-localfs 💾

A local filesystem implementation of the BCS data layer that provides simple and efficient content storage using JSON files in your project directory.

Features 🌟

  • Simple File Storage 📁

    • Store content as JSON files
    • Automatic file organization by schema
    • Easy version control integration
    • Direct file system access
  • Type-Safe Content 🛡️

    • Full TypeScript support
    • Schema-based type generation
    • Runtime type validation
    • Strongly typed content access
  • Developer Friendly 💻

    • Zero configuration needed
    • Instant setup
    • Easy content inspection
    • Human-readable storage format
  • Media Management 🖼️

    • Local media file storage
    • Automatic file organization
    • Public URL generation
    • Media metadata handling

Installation 📦

npm install @bastards/bcs-data-localfs
# or
pnpm add @bastards/bcs-data-localfs
# or
yarn add @bastards/bcs-data-localfs

Usage 🚀

  1. Configure the content endpoints in your bcs.config.ts:
import { defineConfig } from '@bastards/bcs';

export default defineConfig({
  admin: {
    // ... other admin config
    data: {
      content: '/api/bcs/content',  // Content endpoint
      media: '/api/bcs/media'       // Media endpoint
    }
  },
  build: {
    adminOutputDir: './static/admin',
    typesOutputDir: './src/lib/bcs-types'  // Where to generate TypeScript types
  }
});
  1. Set up the content API endpoints in your application (example in SvelteKit):
// src/routes/api/bcs/content/+server.ts
import { localFs } from '@bastards/bcs-data-localfs';

export const GET = async ({ url }) => {
  const storage = localFs();
  return storage.handleContentRequest(url);
};

export const POST = async ({ request }) => {
  const storage = localFs();
  return storage.handleContentRequest(request);
};

// src/routes/api/bcs/media/+server.ts
import { localFs } from '@bastards/bcs-data-localfs';

export const GET = async ({ url }) => {
  const storage = localFs();
  return storage.handleMediaRequest(url);
};

export const POST = async ({ request }) => {
  const storage = localFs();
  return storage.handleMediaRequest(request);
};
  1. Your content will be automatically stored in:
    • ./content/ - JSON files for each schema
    • ./static/media/ - Uploaded media files

Directory Structure 📂

your-project/
├── content/
│   ├── Main.json
│   └── General.json
├── static/
│   ├── media/
│   │   └── uploads/
│   └── admin/
└── src/
    └── lib/
        └── bcs-types/
            └── schema.d.ts

API Reference 📚

The package exports the following:

function localFs(options?: {
  contentDir?: string;     // Override default content directory
  mediaDir?: string;       // Override default media directory
}): StorageHandler;

interface StorageHandler {
  handleContentRequest(urlOrRequest: URL | Request): Promise<Response>;
  handleMediaRequest(urlOrRequest: URL | Request): Promise<Response>;
}

Content Format 📄

Content is stored as JSON files, one per schema:

{
  "welcomeSection": {
    "title": "Welcome to BCS",
    "emoji": "🚀",
    "subtitle": "A modern CMS for modern web development"
  }
}

Contributing 🤝

We welcome contributions! Please see our Contributing Guide for details.

License 📄

MIT - see the main project repository for details.

Learn More 📚

For more information about BCS and its features, check out: