{"library":"rework","title":"Rework CSS Processing Framework","description":"Rework is a plugin framework for CSS preprocessing in Node.js, built upon the `css` package for AST manipulation. It enables developers to create custom CSS transformations, such as automating vendor prefixing, defining custom properties, or inlining images. At version 1.0.1, it provides a simple API (`rework().use(plugin).toString()`) to apply a chain of plugins to a CSS string. The project saw active development around 2012-2014, with its last npm publish over 10 years ago, indicating it is no longer actively maintained. While it offered a robust plugin ecosystem in its time, its stable version is 1.0.1 and it does not follow a current release cadence. Key differentiators at its peak included a straightforward API for AST access and a rich set of community-contributed plugins, predating and offering an alternative to modern PostCSS.","language":"javascript","status":"abandoned","last_verified":"Sun Apr 19","install":{"commands":["npm install rework"],"cli":null},"imports":["const rework = require('rework');","rework(cssString).use(pluginFn);","rework(cssString).use(pluginFn).toString({ sourcemap: true });"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"const rework = require('rework');\n\n// A dummy plugin that adds a vendor prefix to `box-sizing`\nfunction addPrefixPlugin(stylesheet, reworkInstance) {\n  stylesheet.rules.forEach(rule => {\n    if (rule.type === 'rule' && rule.declarations) {\n      rule.declarations.forEach(declaration => {\n        if (declaration.property === 'box-sizing') {\n          rule.declarations.unshift({\n            type: 'declaration',\n            property: '-webkit-box-sizing',\n            value: declaration.value\n          });\n        }\n      });\n    }\n  });\n}\n\nconst cssInput = 'body { font-size: 12px; box-sizing: border-box; }';\n\nconst processedCss = rework(cssInput, { source: 'source.css' })\n  .use(addPrefixPlugin)\n  .toString({ sourcemap: true });\n\nconsole.log(processedCss);\n/* Expected output:\nbody {\n  font-size: 12px;\n  -webkit-box-sizing: border-box;\n  box-sizing: border-box;\n}\n\n/*# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJzb3VyY2VzIjpbInNvdXJjZS5jc3MiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6IkFBQUEsSUFBSSxZQUFZLFNBQVMsa0NBQWtCLENBQUMiLCJmaWxlIjoiZ2VuZXJhdGVkLmNzcyIsInNvdXJjZXNDb250ZW50cyI6WyJib2R5IHsgZm9udC1zaXplOiAxMnB4OyBib3gtc2l6aW5nOiBib3JkZXItYm94OyB9Il19 *//* */","lang":"javascript","description":"Demonstrates applying a simple Rework plugin to add a vendor prefix and generates an inline source map.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}