Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/thecommieaxolotl/filio
A simple configuration loader that supports various file formats such as js, ts, yaml and more.
https://github.com/thecommieaxolotl/filio
coffeescript configuration filio javascript typescript yaml
Last synced: 18 days ago
JSON representation
A simple configuration loader that supports various file formats such as js, ts, yaml and more.
- Host: GitHub
- URL: https://github.com/thecommieaxolotl/filio
- Owner: TheCommieAxolotl
- License: mit
- Created: 2023-04-10T02:49:21.000Z (almost 2 years ago)
- Default Branch: main
- Last Pushed: 2023-04-10T07:26:35.000Z (almost 2 years ago)
- Last Synced: 2025-02-01T23:14:22.654Z (18 days ago)
- Topics: coffeescript, configuration, filio, javascript, typescript, yaml
- Language: TypeScript
- Homepage: https://filiojs.vercel.app/
- Size: 31.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# filio
A simple configuration loader for NodeJS that supports various file formats such as js, ts, yaml and more.## Installation
You can install filio via npm, pnpm or yarn:```bash
npm install filio
pnpm add filio
yarn add filio
```## What does it do?
filio aims to provide a simpl*er* way to load a wide [variety](#supported-formats) of configuration formats.## Usage
filio should work out of the box with no configuration in most scenarios. Simply pass the name of the file you want to load and it will automatically look for the file in the current working directory.```ts
// config.ts
export default {
port: 3000,
};// index.js
import filio from 'filio';const config = filio('config'); // will look for config.json, config.yaml, config.js, etc.
console.log(config.port); // 3000
```If you want to look for a specific file, you can also use `filio.load`:
```ts
import { load } from 'filio';const config = load('.config', "yaml"); // load .config as a yaml file
console.log(config.port); // 3000
```## Supported Formats
- [x] JSON
- [x] YAML
- [x] JS
- [X] JS (commonjs)
- [x] TS
- [x] coffeescript
- [ ] TOML