jonkemp / inline-css

Inline css into an html file.
MIT License
429 stars 84 forks source link

Add feature: Command Line Interface #101

Open fkoyer opened 3 years ago

fkoyer commented 3 years ago

This PR adds a command line interface to make it easier to integrate this tool with other scripts and development tools. I needed this functionality to use this tool as a file watcher in PhpStorm. The script sets the url option to a reasonable default. Tested on Windows 10 and CentOS 7.

Usage: inline-css [FILE]

Description:
  Inline css into an html file.

Options:
  -h, --help     Show this message.
  -v, --version  Print version information.

With no FILE, or when FILE is -, read standard input.
coveralls commented 3 years ago

Coverage Status

Coverage remained the same at 95.897% when pulling 2e046249bf1c7e5eb5e0ac067f025f3f902afef9 on fkoyer:cli into 4291cdf1ffbeddd6c11e963b5b3b5f6e35d5f4ae on jonkemp:master.

jonkemp commented 3 years ago

Interesting idea. Not sure why you essentially blew away the README file though if you want this PR to be accepted.

fkoyer commented 3 years ago

Sorry, that README file wasn't supposed to be part of the PR. I pushed the correct README file. Let me know if you have any questions.

fkoyer commented 3 years ago

Just following up to see if this PR can be merged.

jonkemp commented 3 years ago

I plan on reviewing this over the weekend. Thanks for your patience.

jonkemp commented 3 years ago

I'm willing to accept a PR to add a cli to inline-css with the stipulation that it uses meow, https://github.com/sindresorhus/meow.

I would also suggest get-stdin to get stdin, https://github.com/sindresorhus/get-stdin.

If you're interested, there is a boilerplate that might make this easier, https://github.com/sindresorhus/node-cli-boilerplate.