mirror of
https://github.com/remy/inliner.git
synced 2024-09-11 09:15:41 +03:00
Updated usage
This commit is contained in:
parent
541b3c4097
commit
722c14f522
22
README.md
22
README.md
@ -24,14 +24,26 @@ Alternatively, `inliner` can be run directly from the repository using Node:
|
||||
|
||||
## Usage
|
||||
|
||||
### via npm
|
||||
|
||||
If you installed via npm, then you can use inliner via the command line as per:
|
||||
|
||||
inliner http://remysharp.com
|
||||
|
||||
This will output the inlined markup. You can easily save this to a new file for testing:
|
||||
|
||||
inliner http://remysharp.com > remysharp.html
|
||||
|
||||
### via library
|
||||
|
||||
The inliner.js script requires jsdom to be installed via `npm install jsdom`, otherwise you should be good to run:
|
||||
|
||||
var inliner = require('./inliner').inliner;
|
||||
var inliner = require('./lib/inliner');
|
||||
|
||||
inliner('http://remysharp.com', function (html) {
|
||||
// compressed and inlined HTML page
|
||||
console.log(html);
|
||||
});
|
||||
inliner('http://remysharp.com', function (html) {
|
||||
// compressed and inlined HTML page
|
||||
console.log(html);
|
||||
});
|
||||
|
||||
I plan to include a web service at some point, but obviously this won't be able to access localhost domains.
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user