@luxass/find-config
TypeScript icon, indicating that this package has built-in type declarations

0.1.0 • Public • Published

find-config

Install

npm install @luxass/find-config

Usage

import type { Loader } from "@luxass/find-config";
import { resolveConfig, resolveConfigSync } from "@luxass/find-config";

const cookieLoader: Loader = {
  filter: /\.cookie$/,
  load: async (path) => {
    return {
      name: "cookie from async loader",
    }
  },
  loadSync: (path) => {
    return {
      name: "cookie from sync loader",
    }
  }
}

await resolveConfig({
  files: [
    "package.json",
    "cookie.json",
    "cookie.js",
    "cookie.ts",
    "cookie.cookie",
  ],
  loaders: [
    cookieLoader
  ],
  cwd: process.cwd(),
  name: "cookie", // used as the packageKey for package.json
}) // { name: "cookie from async loader" }

resolveConfigSync({
  files: [
    "package.json",
    "cookie.json",
    "cookie.js",
    "cookie.ts",
    "cookie.cookie",
  ],
  loaders: [
    cookieLoader
  ],
  cwd: process.cwd(),
  name: "cookie", // used as the packageKey for package.json
}) // { name: "cookie from sync loader" }

Readme

Keywords

none

Package Sidebar

Install

npm i @luxass/find-config

Weekly Downloads

0

Version

0.1.0

License

MIT

Unpacked Size

9.42 kB

Total Files

6

Last publish

Collaborators

  • luxass