# @css-blocks/config

> Standardized access to css-blocks configuration files.

Latest version **1.5.0** (published 2020-09-16) · BSD-2-Clause license · 0 weekly downloads

## Install

```sh
npm install @css-blocks/config
pnpm add @css-blocks/config
yarn add @css-blocks/config
bun add @css-blocks/config
```

## Health

**Score 25/100 (F)** — status: abandoned.

Positive: has types; no vulnerabilities; high quality score.

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.5.0 |
| Published | 2020-09-16 |
| First published | 2019-11-22 |
| Weekly downloads | 0 |
| License | BSD-2-Clause |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | 10.* \|\| >= 12.* |
| Dependencies | 4 |
| Unpacked size | 550.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Chris Eppstein |
| Maintainers | epicmiller, chriseppstein |
| Keywords | css-blocks |

## Links

- npm: https://www.npmjs.com/package/@css-blocks/config
- Repository: https://github.com/linkedin/css-blocks
- Homepage: https://github.com/linkedin/css-blocks/tree/master/packages/@css-blocks/config#readme
- Issues: https://github.com/linkedin/css-blocks/issues
- npm.io page: https://npm.io/package/@css-blocks/config

## Dependencies (4)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [cosmiconfig](https://npm.io/package/cosmiconfig.md) ^6.0.0
- [lodash.merge](https://npm.io/package/lodash.merge.md) ^4.6.2
- [@css-blocks/core](https://npm.io/package/@css-blocks/core.md) ^1.5.0

## Recent versions

- 1.5.0 (latest) — 2020-09-16
- 1.0.0-alpha.6 (next) — 2020-02-19
- 1.4.0 — 2020-09-04
- 1.3.2 — 2020-08-20
- 1.3.0 — 2020-08-11
- 1.2.0 — 2020-08-05
- 1.1.2 — 2020-07-20
- 1.1.1 — 2020-06-30
- 1.1.0 — 2020-05-23
- 1.0.0 — 2020-04-04
- 1.0.0-alpha.5 — 2020-02-14
- 1.0.0-alpha.4 — 2019-12-18
- 1.0.0-alpha.3 — 2019-12-11
- 1.0.0-alpha.1 — 2019-12-10
- 1.0.0-alpha.0 — 2019-11-22

## README

# CSS Blocks Configuration

Loads configuration for css-blocks from standardized locations so that build integrations, text editors, and the cli can all interoperate with the same configuration.

## Installation

```
yarn add @css-blocks/config
```

## Usage

```ts
import { Options as CSSBlocksOptions } from "@css-blocks/core";
import * as config from '@css-blocks/config';
// finds configuration starting in the current working directory.
let opts: CSSBlocksOptions | null = config.search();

// finds configuration starting in the specified directory;
opts = config.search(__dirname);

// loads a specific configuration file:
opts = config.load("config/css-blocks.js");
```

## Configuration Options

The values specified in the configuration files are expected to be legal options
for the [CSS Blocks configuration](../core/src/configuration/types.ts).
However, there are a few exceptions:

* `preprocesors` - This can be set to a file location of a javascript file that
  exports one or more preprocessors. The properties exported should correspond to the
  [supported syntaxes](../core/src/BlockParser/preprocessing.ts).
* `importer` - This can be set to a file location of a javascript file that
  exports an object with keys of `importer` and (optionally) `data`. If data
  is returned, it takes precedence over a configuration value for
  `importerData` in the current configuration file.
* `extends` - If provided, this configuration file located at the provided path
  is loaded and this configuration is deeply merged into it. Note: the values
  for `importer` and `importerData` are not deeply merged.
* `rootDir` - If this configuration property is not set explicitly, the directory of the
  configuration file is used.

Note: Any path to another file or directory is interpreted as being relative
to the directory of the file containing the path.

---
_Source: https://npm.io/package/@css-blocks/config · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
