Skip to content

Commit

Permalink
lint: use standard style in readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Feb 25, 2017
1 parent d12be16 commit 8914486
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 10 deletions.
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ cache:
before_install:
# Setup Node.js version-specific dependencies
- "test $TRAVIS_NODE_VERSION != '0.8' || npm rm --save-dev istanbul"
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 4 || npm rm --save-dev eslint eslint-config-standard eslint-plugin-promise eslint-plugin-standard"
- "test $(echo $TRAVIS_NODE_VERSION | cut -d. -f1) -ge 4 || npm rm --save-dev eslint eslint-config-standard eslint-plugin-markdown eslint-plugin-promise eslint-plugin-standard"

# Update Node.js modules
- "test ! -d node_modules || npm prune"
Expand Down
22 changes: 15 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ $ npm install send

## API

<!-- eslint-disable no-unused-vars -->

```js
var send = require('send')
```
Expand Down Expand Up @@ -172,9 +174,11 @@ var http = require('http')
var parseUrl = require('parseurl')
var send = require('send')

var app = http.createServer(function onRequest (req, res) {
var server = http.createServer(function onRequest (req, res) {
send(req, parseUrl(req).pathname).pipe(res)
}).listen(3000)
})

server.listen(3000)
```

### Custom file types
Expand All @@ -192,9 +196,11 @@ send.mime.define({
'application/x-my-type': ['x-mt', 'x-mtt']
})

var app = http.createServer(function onRequest (req, res) {
var server = http.createServer(function onRequest (req, res) {
send(req, parseUrl(req).pathname).pipe(res)
}).listen(3000)
})

server.listen(3000)
```

### Serving from a root directory with custom error-handling
Expand All @@ -204,7 +210,7 @@ var http = require('http')
var parseUrl = require('parseurl')
var send = require('send')

var app = http.createServer(function onRequest (req, res) {
var server = http.createServer(function onRequest (req, res) {
// your custom error-handling logic:
function error (err) {
res.statusCode = err.status || 500
Expand All @@ -230,8 +236,10 @@ var app = http.createServer(function onRequest (req, res) {
.on('error', error)
.on('directory', redirect)
.on('headers', headers)
.pipe(res);
}).listen(3000)
.pipe(res)
})

server.listen(3000)
```

## License
Expand Down
2 changes: 1 addition & 1 deletion appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ cache:
install:
- ps: Install-Product node $env:nodejs_version
- if "%nodejs_version%" equ "0.8" npm rm --save-dev istanbul
- npm rm --save-dev eslint eslint-config-standard eslint-plugin-promise eslint-plugin-standard
- npm rm --save-dev eslint eslint-config-standard eslint-plugin-markdown eslint-plugin-promise eslint-plugin-standard
- if exist node_modules npm prune
- if exist node_modules npm rebuild
- npm install
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
"after": "0.8.2",
"eslint": "3.16.0",
"eslint-config-standard": "6.2.1",
"eslint-plugin-markdown": "1.0.0-beta.3",
"eslint-plugin-promise": "3.4.2",
"eslint-plugin-standard": "2.0.1",
"istanbul": "0.4.5",
Expand All @@ -48,7 +49,7 @@
"node": ">= 0.8.0"
},
"scripts": {
"lint": "eslint .",
"lint": "eslint --plugin markdown --ext js,md .",
"test": "mocha --check-leaks --reporter spec --bail",
"test-ci": "istanbul cover node_modules/mocha/bin/_mocha --report lcovonly -- --check-leaks --reporter spec",
"test-cov": "istanbul cover node_modules/mocha/bin/_mocha -- --check-leaks --reporter dot"
Expand Down

0 comments on commit 8914486

Please sign in to comment.