1.0.2 • Published 2 years ago

parse.config.ts v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

parse.config.ts is a TypeScript configuration file parser designed to make it easy to work with configuration files in TypeScript projects. It enables you to load and parse configuration files efficiently, providing a typed interface for accessing configuration properties.

Features

  • Easy parsing of TypeScript configuration files.
  • Returns typed configuration objects.
  • Simple, lightweight, and easy to integrate.

Installation

Install parse.config.ts using npm:

npm install parse.config.ts

Usage

Here's how you can use parse.config.ts to parse a configuration file:

  1. Create a configuration file, for example, my.config.ts:

    export default {
        key: 'value',
        numberKey: 42
    };
  2. Use parse.config.ts to load and parse the configuration:

    import { parseConfig } from 'parse.config.ts';
    
    interface Config {
        key: string;
        numberKey: number;
    }
    
    async function loadConfiguration() {
        try {
            const config = await parseConfig<Config>('./my.config.ts');
            console.log(config);
        } catch (error) {
            console.error('Error loading configuration:', error);
        }
    }
    
    loadConfiguration();

Contributing

Contributions are welcome! If you have a bug report, feature request, or a pull request, please feel free to contribute.

  1. Fork the repository.
  2. Create a new branch for each feature or improvement.
  3. Send a pull request from each feature branch.

Contact

If you have any questions or suggestions, please reach out to Daniel Boll at danielboll.dev@proton.me.

License

parse.config.ts is available under the MIT license. See the LICENSE file for more info.

1.0.2

2 years ago

1.0.0

2 years ago