# rework

> Plugin framework for CSS preprocessing

Latest version **1.0.1** (published 2014-08-28) · 0 weekly downloads

## Install

```sh
npm install rework
pnpm add rework
yarn add rework
bun add rework
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2014-08-28 |
| First published | 2012-09-01 |
| Weekly downloads | 0 |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2737 |
| Author | TJ Holowaychuk |
| Maintainers | tjholowaychuk, jonathanong, jongleberry, conradz, necolas, anthonyshort, ianstormtaylor, moox, clintwood, lydell, slexaxton |
| Keywords | css, manipulation, preprocess, transform, server |

## Links

- npm: https://www.npmjs.com/package/rework
- Repository: https://github.com/reworkcss/rework
- Issues: https://github.com/reworkcss/rework/issues
- npm.io page: https://npm.io/package/rework

## Dependencies (2)

- [css](https://npm.io/package/css.md) ^2.0.0
- [convert-source-map](https://npm.io/package/convert-source-map.md) ^0.3.3

## 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

- 1.0.1 (latest) — 2014-08-28
- 1.0.0 — 2014-06-19
- 0.20.3 — 2014-05-08
- 0.20.2 — 2014-01-02
- 0.20.1 — 2013-12-23
- 0.20.0 — 2013-12-23
- 0.19.0 — 2013-12-23
- 0.18.3 — 2013-10-18
- 0.18.2 — 2013-10-16
- 0.18.1 — 2013-09-03
- 0.18.0 — 2013-09-03
- 0.17.4 — 2013-08-22
- 0.17.3 — 2013-07-28
- 0.17.2 — 2013-07-11
- 0.17.1 — 2013-07-03
- … 30 more at https://npm.io/package/rework/versions

## README

# rework

[![npm package version](https://img.shields.io/npm/v/rework) ![npm downloads](https://img.shields.io/npm/dm/rework)](https://www.npmjs.com/package/rework)
[![GitHub Workflow Status](https://img.shields.io/github/actions/workflow/status/reworkcss/rework/test.yml)](https://github.com/reworkcss/rework/actions)
[![License](https://img.shields.io/github/license/reworkcss/rework)](https://github.com/reworkcss/rework)  

> [!NOTE]  
> There have not been material changes to this package in 10 years. New changes and bug fixes are not planned. In the event of concrete security issues, changes may still occur. We recommend moving to something else more modern.

CSS manipulations built on [`css`](https://github.com/reworkcss/css), allowing
you to automate vendor prefixing, create your own properties, inline images,
anything you can imagine!

Please refer to [`css`](https://github.com/reworkcss/css) for AST documentation
and to report parser/stringifier issues.

## Installation

    $ npm install rework

## Usage

```js
var rework = require('rework');
var pluginA = require('pluginA');
var pluginB = require('pluginB');

rework('body { font-size: 12px; }', { source: 'source.css' })
  .use(pluginA)
  .use(pluginB)
  .toString({ sourcemap: true })
```

## API

### rework(code, [options])

Accepts a CSS string and returns a new `Rework` instance. The `options` are
passed directly to `css.parse`.

### Rework#use(fn)

Use the given plugin `fn`. A rework "plugin" is simply a function accepting the
stylesheet root node and the `Rework` instance.

### Rework#toString([options])

Returns the string representation of the manipulated CSS. The `options` are
passed directly to `css.stringify`.

Unlike `css.stringify`, if you pass `sourcemap: true` a string will still be
returned, with the source map inlined. Also use `sourcemapAsObject: true` if
you want the `css.stringify` return value.

## Plugins

Rework has a rich collection of plugins and mixins. Browse all the [Rework
plugins](https://www.npmjs.org/search?q=rework) available on npm.

Plugins of particular note:

- [at2x](https://github.com/reworkcss/rework-plugin-at2x/) – serve high resolution images
- [calc](https://github.com/reworkcss/rework-calc) – resolve simple `calc()` expressions
- [colors](https://github.com/reworkcss/rework-plugin-colors/) – color helpers like `rgba(#fc0, .5)`
- [ease](https://github.com/reworkcss/rework-plugin-ease/) – several additional easing functions
- [extend](https://github.com/reworkcss/rework-inherit/) – `extend: selector` support
- [function](https://github.com/reworkcss/rework-plugin-function/) – user-defined CSS functions
- [import](https://github.com/reworkcss/rework-import) – read and inline CSS via `@import`
- [inline](https://github.com/reworkcss/rework-plugin-inline) – inline assets as data URIs
- [mixin](https://github.com/reworkcss/rework-plugin-mixin/) – custom property logic with mixins
- [npm](https://github.com/reworkcss/rework-npm) - inline CSS via `@import` using node's module resolver
- [references](https://github.com/reworkcss/rework-plugin-references/) – property references like `height: @width`
- [url](https://github.com/reworkcss/rework-plugin-url/) – rewrite `url()`s with a given function
- [variables](https://github.com/reworkcss/rework-vars/) – W3C-style variables

## Built with rework

- [styl](https://github.com/visionmedia/styl)
- [rework-pure-css](https://github.com/ianstormtaylor/rework-pure-css)
- [rework-suit](https://github.com/suitcss/rework-suit)
- [resin](https://github.com/topcoat/resin)
- [Myth](https://github.com/segmentio/myth)

## [License](./LICENSE)

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