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

localflare-core

v0.4.1

Published

Core utilities for Localflare - config parsing and binding discovery

Readme

localflare-core

Core configuration parser and utilities for Localflare.

npm version License: MIT

Overview

This package provides core utilities for Localflare:

  • Config Parser - Reads and parses wrangler.toml / wrangler.json / wrangler.jsonc configuration files
  • Binding Discovery - Extracts D1, KV, R2, Durable Objects, and Queue binding configurations
  • Type Definitions - TypeScript types for wrangler configuration and Localflare manifests

Installation

npm install localflare-core
# or
pnpm add localflare-core

Usage

import {
  parseWranglerConfig,
  findWranglerConfig,
  WRANGLER_CONFIG_FILES
} from 'localflare-core';

// Find wrangler config in current directory
const configPath = findWranglerConfig(process.cwd());
// Returns: ./wrangler.toml, ./wrangler.json, or ./wrangler.jsonc

// Parse the configuration
const config = parseWranglerConfig(configPath);

// Access binding configurations
console.log(config.d1_databases);    // D1 database bindings
console.log(config.kv_namespaces);   // KV namespace bindings
console.log(config.r2_buckets);      // R2 bucket bindings
console.log(config.durable_objects); // Durable Object bindings
console.log(config.queues);          // Queue producer/consumer config

API Reference

findWranglerConfig(directory: string): string | null

Searches for a wrangler configuration file in the specified directory.

const configPath = findWranglerConfig('/path/to/project');
// Returns: '/path/to/project/wrangler.toml' or null

parseWranglerConfig(configPath: string): WranglerConfig

Parses a wrangler configuration file (TOML, JSON, or JSONC format).

const config = parseWranglerConfig('./wrangler.toml');

WRANGLER_CONFIG_FILES

Array of supported config file names: ['wrangler.toml', 'wrangler.json', 'wrangler.jsonc']

Types

interface WranglerConfig {
  name?: string;
  main?: string;
  compatibility_date?: string;
  d1_databases?: D1DatabaseConfig[];
  kv_namespaces?: KVNamespaceConfig[];
  r2_buckets?: R2BucketConfig[];
  durable_objects?: { bindings: DurableObjectConfig[] };
  queues?: {
    producers?: QueueProducerConfig[];
    consumers?: QueueConsumerConfig[];
  };
  vars?: Record<string, string>;
  // ... and more
}

interface LocalflareManifest {
  name: string;
  d1: { binding: string; database_name: string }[];
  kv: { binding: string }[];
  r2: { binding: string; bucket_name: string }[];
  queues: {
    producers: { binding: string; queue: string }[];
    consumers: { queue: string; max_batch_size?: number; /* ... */ }[];
  };
  do: { binding: string; className: string }[];
}

Related Packages

| Package | Description | |---------|-------------| | localflare | CLI tool (main package) | | localflare-api | Dashboard API worker |

License

MIT