New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

easycli-config

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

easycli-config

Configuration loader for EasyCLI

latest
npmnpm
Version
0.1.2
Version published
Maintainers
1
Created
Source

easycli-config

Zero-config configuration loader for EasyCLI apps.

Features

  • Zero Config: Works out of the box.
  • Hierarchical Loading: Loads from home directory, project directory, and environment variables.
  • Multiple Formats: Supports JSON, JS, and TS config files.
  • Type Safe: Fully typed with TypeScript.

Installation

pnpm add easycli-config

Usage

import { loadConfig } from "easycli-config";

interface MyConfig {
  port: number;
  dbUrl: string;
}

// Loads and merges config from all supported sources
const config = await loadConfig<MyConfig>();

console.log(config);

Configuration Search Order

Configuration is merged in the following order (last one wins):

  • Home Directory: ~/.easyclirc.json
  • Project Directory (searched in order):
    • .easyclirc.json
    • .easyclirc
    • easycli.config.json
    • easycli.config.js
    • easycli.config.ts
  • Environment Variables: Variables starting with EASYCLI_
    • EASYCLI_PORT=3000 -> { port: 3000 }
    • EASYCLI_DB_URL=postgres://... -> { db: { url: "postgres://..." } }

API

loadConfig<T>(options?: ConfigLoaderOptions): Promise<T>

Loads the configuration.

  • options.cwd: Directory to search for config files (default: process.cwd())
  • options.name: Config name namespace (default: "easycli")

FAQs

Package last updated on 19 Jan 2026

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts