Skip to content

Commit

Permalink
Updated usage
Browse files Browse the repository at this point in the history
  • Loading branch information
remy committed Mar 14, 2011
1 parent 541b3c4 commit 722c14f
Showing 1 changed file with 17 additions and 5 deletions.
22 changes: 17 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down

0 comments on commit 722c14f

Please sign in to comment.