Skip to content

Commit

Permalink
chore(package): setup Travis-CI
Browse files Browse the repository at this point in the history
  • Loading branch information
terinjokes committed Feb 2, 2016
1 parent 3f5d845 commit f8fe400
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 7 deletions.
14 changes: 14 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
language: node_js
sudo: false
node_js:
- 0.10
- 0.12
- 4.2
- node
before_install:
- npm install -g npm@latest-2
after_success:
- npm run coverage
branches:
except:
- "/^v\\d+\\.\\d+\\.\\d+$/"
10 changes: 8 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# netjet
# netjet [![Travis-CI Status](https://img.shields.io/travis/cloudflare/netjet/master.svg?label=Travis%20CI&style=flat-square)](https://travis-ci.org/cloudflare/netjet)[![](https://img.shields.io/npm/dm/netjet.svg?style=flat-square)](http://browsenpm.org/package/netjet)[![](https://img.shields.io/npm/v/netjet.svg?style=flat-square)](http://browsenpm.org/package/netjet)[![](https://img.shields.io/coveralls/cloudflare/netjet/master.svg?style=flat-square)](https://coveralls.io/github/cloudflare/netjet)[![](https://img.shields.io/badge/stability-experimental-orange.svg?style=flat-square)](https://nodejs.org/api/documentation.html#documentation_stability_index)

netjet is a Node.js HTTP middleware to automatically insert [Preload][preload] link headers in HTML responses.
These Preload link headers allow for web browsers to initiate early resource fetching before being needed for execution.
Expand All @@ -16,7 +16,13 @@ express()
.listen(1337);
```

## Node.js 0.10 Requirements

This module utilizes the [`posthtml`][posthtml] module to find images, scripts, and stylesheets in your HTML response.
PostHTML requires a native Promise implementation or shim, so users of Node.js 0.10 will need to ensure a Promise shim has been configured.

## License
[MIT](https://www.tldrlegal.com/l/mit), see `LICENSE.md`.
[![MIT License](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://www.tldrlegal.com/l/mit) see `LICENSE.md`.

[preload]: https://www.w3.org/TR/preload/
[posthtml]: https://github.com/posthtml/posthtml
11 changes: 7 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,12 @@
"description": "Express middleware to generate preload headers",
"main": "index.js",
"scripts": {
"test": "xo && istanbul cover -- _mocha --check-leaks --reporter spec"
"test": "xo && istanbul cover -- _mocha --check-leaks --reporter spec",
"coverage": "cat ./coverage/lcov.info | coveralls"
},
"repository": {
"type": "git",
"url": "git+https://github.com/cloudflare/vahevara.git"
"url": "git+https://github.com/cloudflare/netjet.git"
},
"keywords": [
"express",
Expand All @@ -19,9 +20,9 @@
"author": "Terin Stock <[email protected]> (https://terinstock.com/)",
"license": "MIT",
"bugs": {
"url": "https://github.com/cloudflare/vahevara/issues"
"url": "https://github.com/cloudflare/netjet/issues"
},
"homepage": "https://github.com/cloudflare/vahevara#readme",
"homepage": "https://github.com/cloudflare/netjet#readme",
"files": [
"index.js",
"posthtml-preload.js"
Expand All @@ -36,6 +37,8 @@
},
"devDependencies": {
"assume": "^1.3.1",
"core-js": "^2.0.3",
"coveralls": "^2.11.6",
"detour": "^1.3.0",
"istanbul": "^0.4.2",
"mocha": "^2.4.5",
Expand Down
7 changes: 6 additions & 1 deletion test/preload.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
'use strict';
/* globals describe, before, it */
require('core-js/shim');

var describe = require('mocha').describe;
var before = require('mocha').before;
var it = require('mocha').it;
var expect = require('assume');

var http = require('http');
var preload = require('../');
var request = require('supertest');
Expand Down

0 comments on commit f8fe400

Please sign in to comment.