https://github.com/adueck/inline-css-cli
A CLI wrapper inline css through stdin - stdout
https://github.com/adueck/inline-css-cli
cli inline-css node
Last synced: about 1 month ago
JSON representation
A CLI wrapper inline css through stdin - stdout
- Host: GitHub
- URL: https://github.com/adueck/inline-css-cli
- Owner: adueck
- License: mit
- Created: 2019-04-25T19:39:30.000Z (about 7 years ago)
- Default Branch: master
- Last Pushed: 2019-04-26T06:07:53.000Z (about 7 years ago)
- Last Synced: 2025-06-13T14:11:25.747Z (12 months ago)
- Topics: cli, inline-css, node
- Language: JavaScript
- Size: 26.4 KB
- Stars: 4
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# inline-css-cli
A simple CLI wrapper for [inline-css](https://www.npmjs.com/package/inline-css). For inlining html through stdin - stdout.
This is useful if you want to inline files from the command line, or use it programattically in non-JS environments.
### Installation
```
git clone https://github.com/adueck/inline-css-cli
cd inline-css-cli
npm install
npm link
```
### Usage
```
$ echo "p { color: red; }
Hello World
" | inline-css
```
output (to stdout)
```
Hello World
```
Want to use this programatically from a different environment but want a faster response?
### Bonus HTTP Server:
You can also run
```
node http-index.js
```
To get a http server that will inline the html you send in a http request body.
```
curl -d "p{color:red;}
Hello World
" -X POST http://localhost:8081/
```
Response:
```
Hello World
```