Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/castastrophe/postcss-licensing
postcss-licensing
https://github.com/castastrophe/postcss-licensing
Last synced: about 1 month ago
JSON representation
postcss-licensing
- Host: GitHub
- URL: https://github.com/castastrophe/postcss-licensing
- Owner: castastrophe
- License: apache-2.0
- Created: 2023-03-25T03:07:07.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2024-10-04T19:02:09.000Z (about 1 month ago)
- Last Synced: 2024-10-14T11:19:39.906Z (about 1 month ago)
- Language: JavaScript
- Size: 958 KB
- Stars: 0
- Watchers: 4
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Funding: FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# postcss-licensing
> Prepends licensing information to CSS files
## Installation
```sh
yarn add -D postcss-licensing
postcss -u postcss-licensing -o dist/index.css src/index.css
```## Usage
This plugin will prepend your CSS file with a copyright/license. If no path or filename is provided, the plugin will try to find a file with the name `LICENSE` or `COPYRIGHT` at the cwd of the postcss config.
You can expect to turn a file like this:
```css
.spectrum--express {
--spectrum-actionbutton-border-color: transparent;
--spectrum-actionbutton-background-color: purple;
}```
into this:
```css
/*!
*
*/.spectrum--express {
--spectrum-actionbutton-background-color: purple;
--spectrum-actionbutton-border-color: transparent;
}```
## Options
- `filename` [type: `string[] or string`]: optional filename or set of possible filenames. A single filename or full path is allowed. The first item found in the array will be used so be sure to provide them in priority order. Defaults to: `["COPYRIGHT", "LICENSE"]`.
- `cwd` [type: `string`]: optional working directory from which to search for license files. Defaults to: `process.cwd()`.
- `skipIfEmpty` [type: `boolean`]: if true, skips adding the license when the rest of the file is empty. Defaults to: `true`.### Example
```js
postcss([
require('postcss-licensing')({
filename: 'LICENSE.txt',
cwd: path.join(process.cwd(), '../../'),
skipIfEmpty: false,
})
]).process(...)
```