raclette

1.0.3 • Public • Published

raclette Build Status 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.

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.

Package Sidebar

Install

npm i raclette

Weekly Downloads

0

Version

1.0.3

License

MIT

Last publish

Collaborators

  • njakob