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

@f-o-t/config

v1.0.6

Published

Standardized configuration for F-O-T libraries

Readme

@f-o-t/config

Standardized configuration for F-O-T libraries. Provides a type-safe configuration system with validation, plugins, and config file generators.

Installation

bun add @f-o-t/config

Usage

Basic Usage

The simplest way to use @f-o-t/config is to call defineFotConfig() with no arguments to get default configuration:

import { defineFotConfig } from "@f-o-t/config";

const config = defineFotConfig();
// Returns default config with ESM format, TypeScript declarations, and Biome enabled

With Custom Options

Customize the configuration by passing options:

import { defineFotConfig } from "@f-o-t/config";

const config = defineFotConfig({
  formats: ["esm", "cjs"],
  external: ["react", "react-dom"],
  typescript: {
    declaration: true,
    isolatedDeclarations: false,
    maxMemory: 4096,
  },
  biome: {
    enabled: true,
  },
});

With Plugins

Enable and configure plugins:

import { defineFotConfig } from "@f-o-t/config";

const config = defineFotConfig({
  plugins: [
    { name: "datetime", enabled: true },
    { name: "pdf", enabled: false },
  ],
});

Generate Config Files

The library provides generators to create standard configuration files for your FOT library:

import { 
  defineFotConfig,
  generatePackageJson, 
  generateTSConfig, 
  generateBiomeConfig 
} from "@f-o-t/config";

// First, define your configuration
const config = defineFotConfig({
  external: ["zod"],
  plugins: ["operators"],
});

// Generate package.json
const packageJson = generatePackageJson(
  "my-library",  // library name (without @f-o-t/ prefix)
  "1.0.0",       // version
  config,        // resolved config
  { "zod": "^4.3.6" }  // optional custom dependencies
);

// Generate tsconfig.json
const tsconfig = generateTSConfig(config);

// Generate biome.json
const biomeConfig = generateBiomeConfig(config);

API Reference

defineFotConfig(config?: FotConfig): ResolvedFotConfig

Main factory function to define and validate a FOT library configuration.

Parameters:

  • config (optional): Configuration object

Returns: Validated configuration with all defaults applied

Throws: Error if configuration is invalid

Types

FotConfig

User-provided configuration:

interface FotConfig {
  formats?: BuildFormat[];        // Build output formats (default: ["esm"])
  external?: string[];            // External dependencies (default: [])
  typescript?: TypeScriptOptions; // TypeScript options
  biome?: BiomeOptions;          // Biome options
  plugins?: PluginConfig[];      // Plugin configurations (default: [])
}

ResolvedFotConfig

Fully resolved configuration with all defaults applied:

interface ResolvedFotConfig {
  formats: BuildFormat[];
  external: string[];
  typescript: {
    declaration: boolean;
    isolatedDeclarations: boolean;
    maxMemory?: number;
  };
  biome: Required<BiomeOptions>;
  plugins: PluginConfig[];
}

BuildFormat

type BuildFormat = "esm" | "cjs";

TypeScriptOptions

interface TypeScriptOptions {
  declaration?: boolean;          // Generate .d.ts files (default: true)
  isolatedDeclarations?: boolean; // Use isolated declarations mode for faster, more memory-efficient declaration generation (default: false)
  maxMemory?: number;             // Maximum memory (in MB) to allocate for TypeScript declaration generation (default: undefined)
}

BiomeOptions

interface BiomeOptions {
  enabled?: boolean;  // Enable Biome (default: true)
}

PluginConfig

interface PluginConfig {
  name: string;      // Plugin name
  enabled?: boolean; // Enable plugin (default: true)
}

Generators

generatePackageJson(libraryName, version, config, customDependencies?)

Generates a standard package.json configuration for FOT libraries.

Parameters:

  • libraryName: Library name (without @f-o-t/ prefix)
  • version: Package version
  • config: Resolved FOT configuration (ResolvedFotConfig)
  • customDependencies (optional): Custom dependencies to include in the package.json

Returns: PackageJson object

Example:

const pkg = generatePackageJson(
  "my-library",
  "1.0.0",
  config,
  { "zod": "^4.3.6" }
);

generateTSConfig(config)

Generates a standard TypeScript configuration optimized for FOT libraries.

Parameters:

  • config: Resolved FOT configuration (ResolvedFotConfig)

Returns: TSConfig object

Example:

const tsconfig = generateTSConfig(config);

generateBiomeConfig(config)

Generates a standard Biome configuration for linting and formatting.

Parameters:

  • config: Resolved FOT configuration (ResolvedFotConfig)

Returns: BiomeConfig object

Example:

const biomeConfig = generateBiomeConfig(config);

License

MIT