https://github.com/njakob/raclette
Handle your rc files with ease
https://github.com/njakob/raclette
config flowtype helper javascript library loader nodejs npm rc-files resolver
Last synced: 3 months ago
JSON representation
Handle your rc files with ease
- Host: GitHub
- URL: https://github.com/njakob/raclette
- Owner: njakob
- License: mit
- Created: 2017-01-22T19:53:42.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-02-25T13:27:27.000Z (over 9 years ago)
- Last Synced: 2025-10-26T11:26:45.512Z (8 months ago)
- Topics: config, flowtype, helper, javascript, library, loader, nodejs, npm, rc-files, resolver
- Language: JavaScript
- Homepage:
- Size: 39.1 KB
- Stars: 1
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# raclette [![NPM version][npm-status-image]][npm] [![Build Status][build-status-image]][travis] [![ESLint Config][eslint-config-image]][eslint-config]
> Handle your rc files with ease.
Raclette is a resolver for JSON or javascript rc files of your Node.js libraries or
applications.
## Features
* JSON, javascript loaders
* Flowtype definitions
## Installation
With NPM:
```
$ npm install raclette
```
With Yarn:
```
$ yarn add raclette
```
## Usage
Raclette rc files resolution uses *strategies* and *loaders* which you need to
provide as options.
```js
import * as rc from 'raclette';
import type { ResolveResult } from 'raclette';
rc.resolve({
name: '.eslintrc',
strategies: [
rc.strategies.cwd,
rc.strategies.home,
],
loaders: [
rc.loaders.json,
],
}).then((result: ResolveResult) => {
console.log(result);
}).catch((err) => {
console.error(err);
});
```
### Strategy
A _strategy_ generate a set of paths where the resolver need to look for rc
files.
* `rc.strategies.cwd`: Current working directory
* `rc.strageties.home`: Current user home directry
### Loader
A _loader_ try to load and parse rc files in a given location in the file
system.
* `rc.loaders.json`: Load rc files in JSON format
* `rc.loaders.javascript`: Load rc files in javascript format
## Licences
`njakob/raclette` is licensed under the [MIT License][licence].
[licence]: LICENSE
[eslint-config]: https://github.com/njakob/raclette
[npm]: https://nodei.co/npm/raclette
[travis]: https://travis-ci.org/njakob/raclette
[npm-status-image]: https://img.shields.io/npm/v/raclette.svg
[build-status-image]: https://travis-ci.org/njakob/raclette.svg?branch=master
[eslint-config-image]: https://img.shields.io/badge/eslint_config-njakob-463fd4.svg