Skip to content

Commit

Permalink
lint: apply standard style to readme
Browse files Browse the repository at this point in the history
  • Loading branch information
dougwilson committed Apr 24, 2020
1 parent 5ade247 commit 48a7f68
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 6 deletions.
20 changes: 15 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ so open a PR there if you'd like to add mime types.

## API

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

```js
var mime = require('mime-types')
```
Expand All @@ -46,11 +48,13 @@ All functions return `false` if input is invalid or not found.

Lookup the content-type associated with a file.

<!-- eslint-disable no-undef -->

```js
mime.lookup('json') // 'application/json'
mime.lookup('.md') // 'text/markdown'
mime.lookup('file.html') // 'text/html'
mime.lookup('folder/file.js') // 'application/javascript'
mime.lookup('json') // 'application/json'
mime.lookup('.md') // 'text/markdown'
mime.lookup('file.html') // 'text/html'
mime.lookup('folder/file.js') // 'application/javascript'
mime.lookup('folder/.htaccess') // false

mime.lookup('cats') // false
Expand All @@ -64,8 +68,10 @@ content-type, otherwise the given content-type is used. Then if the
content-type does not already have a `charset` parameter, `mime.charset`
is used to get the default charset and add to the returned content-type.

<!-- eslint-disable no-undef -->

```js
mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
mime.contentType('markdown') // 'text/x-markdown; charset=utf-8'
mime.contentType('file.json') // 'application/json; charset=utf-8'
mime.contentType('text/html') // 'text/html; charset=utf-8'
mime.contentType('text/html; charset=iso-8859-1') // 'text/html; charset=iso-8859-1'
Expand All @@ -78,6 +84,8 @@ mime.contentType(path.extname('/path/to/file.json')) // 'application/json; chars

Get the default extension for a content-type.

<!-- eslint-disable no-undef -->

```js
mime.extension('application/octet-stream') // 'bin'
```
Expand All @@ -86,6 +94,8 @@ mime.extension('application/octet-stream') // 'bin'

Lookup the implied default charset of a content-type.

<!-- eslint-disable no-undef -->

```js
mime.charset('text/markdown') // 'UTF-8'
```
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@
"eslint": "6.8.0",
"eslint-config-standard": "14.1.1",
"eslint-plugin-import": "2.20.2",
"eslint-plugin-markdown": "1.0.2",
"eslint-plugin-node": "11.1.0",
"eslint-plugin-promise": "4.2.1",
"eslint-plugin-standard": "4.0.1",
Expand All @@ -35,7 +36,7 @@
"node": ">= 0.6"
},
"scripts": {
"lint": "eslint .",
"lint": "eslint --plugin markdown --ext js,md .",
"test": "mocha --reporter spec test/test.js",
"test-cov": "nyc --reporter=html --reporter=text npm test",
"test-travis": "nyc --reporter=text npm test"
Expand Down

0 comments on commit 48a7f68

Please sign in to comment.