# @vcl/preprocessor

> The VCL preprocessor

Latest version **0.6.3** (published 2019-11-18) · MIT license · 0 weekly downloads

## Install

```sh
npm install @vcl/preprocessor
pnpm add @vcl/preprocessor
yarn add @vcl/preprocessor
bun add @vcl/preprocessor
```

Provides the command `vcl-preprocessor`.

## Health

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

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.6.3 |
| Published | 2019-11-18 |
| First published | 2017-06-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 20 |
| Unpacked size | 91.6 KB |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| Author | n-fuse GmbH |
| Maintainers | benbruda, dani723, henriarm, vanthome |
| Keywords | vcl, modular, css, preprocessor, postcss, npm |

## Links

- npm: https://www.npmjs.com/package/@vcl/preprocessor
- Homepage: https://github.com/vcl/preprocessor
- npm.io page: https://npm.io/package/@vcl/preprocessor

## Dependencies (20)

- [chalk](https://npm.io/package/chalk.md) ^3.0.0
- [debug](https://npm.io/package/debug.md) ^4.1.1
- [yargs](https://npm.io/package/yargs.md) ^15.0.1
- [cssnano](https://npm.io/package/cssnano.md) ^4.1.10
- [postcss](https://npm.io/package/postcss.md) ^7.0.21
- [sugarss](https://npm.io/package/sugarss.md) ^2.0.0
- [unionfs](https://npm.io/package/unionfs.md) ^4.0.0
- [chokidar](https://npm.io/package/chokidar.md) ^3.3.0
- [make-dir](https://npm.io/package/make-dir.md) ^3.0.0
- [memory-fs](https://npm.io/package/memory-fs.md) ^0.5.0
- [autoprefixer](https://npm.io/package/autoprefixer.md) ^9.7.1
- [postcss-import](https://npm.io/package/postcss-import.md) 12.0.1
- [postcss-loader](https://npm.io/package/postcss-loader.md) ^3.0.0
- [postcss-hexrgba](https://npm.io/package/postcss-hexrgba.md) ^2.0.0
- [postcss-nesting](https://npm.io/package/postcss-nesting.md) ^7.0.1
- [postcss-clearfix](https://npm.io/package/postcss-clearfix.md) ^2.0.1
- [postcss-preset-env](https://npm.io/package/postcss-preset-env.md) ^6.7.0
- [postcss-css-variables](https://npm.io/package/postcss-css-variables.md) ^0.13.0
- [postcss-color-function](https://npm.io/package/postcss-color-function.md) ^4.1.0
- [postcss-at-rules-variables](https://npm.io/package/postcss-at-rules-variables.md) ^0.1.9

## Alternatives

- [style-dictionary](https://npm.io/package/style-dictionary.md) — 2.0M weekly downloads
- [postcss-merge-idents](https://npm.io/package/postcss-merge-idents.md) — 1.7M weekly downloads
- [@fontsource/noto-sans](https://npm.io/package/@fontsource/noto-sans.md) — 93.0K weekly downloads
- [uglifycss](https://npm.io/package/uglifycss.md) — 71.6K weekly downloads
- [mat4-interpolate](https://npm.io/package/mat4-interpolate.md) — 23.3K weekly downloads

## Recent versions

- 0.6.3 (latest) — 2019-11-18
- 0.7.0-alpha.3 (next) — 2020-01-08
- 0.7.0-alpha.1 — 2019-11-21
- 0.6.2 — 2019-09-05
- 0.6.0-6 — 2019-09-03
- 0.6.0-1 — 2019-09-02
- 0.5.3 — 2019-08-13
- 0.4.6 — 2019-08-13
- 0.4.5 — 2019-07-19
- 0.4.3 — 2019-07-19
- 0.4.2 — 2019-04-25
- 0.4.0 — 2019-03-22
- 0.4.0-beta.3 — 2019-03-22
- 0.4.0-beta.1 — 2019-03-18
- 0.4.0-beta.0 — 2019-03-15
- … 28 more at https://npm.io/package/@vcl/preprocessor/versions

## README

# [VCL](https://vcl.github.io/) preprocessor

The VCL preprocessor allows to create builds from NPM based CSS modules.
It is based on webpack and the [postcss](https://github.com/postcss/postcss)
processor framework.

## Installation

```sh
$ npm install @vcl/preprocessor
```

## Usage

### Command Line

```sh
Usage: vcl-preprocessor <input> <output>
```

Options:
  --version, -v              Show version number
  --help, -h                 Show help
  --watch, -w                watches the input file for changes
  --import-root, -i          base directory for file based imports
  --optimize, o              optimize css
  --source-map, -s           generate source maps
  --source-map-inline, -si   generate source maps

Examples:
```sh
vcl-preprocessor index.sss compiled.css     # Compile index.sss and output to compiled.css
```
The VCL CLI will create the destination directory if it does not exist.

```sh
echo "a\n  color: green" | vcl-preprocessor # Pipe string through preprocessor
```

### API

```js
var vcl = require('@vcl/preprocessor');

// Will compile the input file and store the result in the output file
vcl(inputFile, outputFile, opts).then((result) => {
  result.css; // compiled css
});

// Will compile the input file and store the result in the output file
// Also recompiles the output file on changes
vcl.compileFile(inputFile, outputFile, opts).then(...);

// Will return an array of postCSS plugins
var plugins = vcl.createPostCSSPlugins(opts);
```
#### Options

- `root` [`process.cwd()`] base directory for file based imports.
- `sourceMap` [false] creates a source map
- `optimize` [false] optimizes css
- `url` [true] follows urls

## Entry CSS File

The following ways to import CSS files are supported:

```css
@import "node-module-name";
@import "node-module-name/file";
@import "./local-file-relative-to-this.css";
```

## Features

- Node module and local file imports via [postcss-import](https://github.com/postcss/postcss-import).
- Support for CSS level 4 proposed `color()` function via [postcss-color-function](https://github.com/postcss/postcss-color-function).
- CSS level 4 variables syntax [postcss-css-variables](https://github.com/MadLittleMods/postcss-css-variables).
- Next gen CSS features via [postcss-preset-env](https://preset-env.cssdb.org/).
- Support for nest style rules, following the CSS Nesting specification [postcss-nesting](https://github.com/jonathantneal/postcss-nesting/).
- Support for color functions such as `rgba()` via [postcss-hexrgba](https://github.com/seaneking/postcss-hexrgba).
- Simple `clear: fix` construct via [postcss-clearfix](https://github.com/seaneking/postcss-clearfix/).

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