Skip to content

Commit 8db74d2

Browse files
committed
Bump deps, minimum node version
1 parent 3cf7784 commit 8db74d2

File tree

9 files changed

+2523
-49
lines changed

9 files changed

+2523
-49
lines changed

.eslintrc.json

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
{
2+
"env": {
3+
"commonjs": true,
4+
"es6": true,
5+
"node": true,
6+
"mocha": true
7+
},
8+
"extends": "eslint:recommended",
9+
"globals": {
10+
"Atomics": "readonly",
11+
"SharedArrayBuffer": "readonly"
12+
},
13+
"parserOptions": {
14+
"ecmaVersion": 2018
15+
},
16+
"rules": {
17+
"eqeqeq": ["error", "smart"],
18+
"no-var": ["error"],
19+
"prefer-const": ["error"]
20+
}
21+
}

.gitignore

Lines changed: 77 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,110 @@
1-
21
# Created by https://www.gitignore.io/api/node
2+
# Edit at https://www.gitignore.io/?templates=node
33

44
### Node ###
55
# Logs
66
logs
77
*.log
88
npm-debug.log*
9+
yarn-debug.log*
10+
yarn-error.log*
11+
lerna-debug.log*
12+
13+
# Diagnostic reports (https://nodejs.org/api/report.html)
14+
report.[0-9]*.[0-9]*.[0-9]*.[0-9]*.json
915

1016
# Runtime data
1117
pids
1218
*.pid
1319
*.seed
20+
*.pid.lock
1421

1522
# Directory for instrumented libs generated by jscoverage/JSCover
1623
lib-cov
1724

1825
# Coverage directory used by tools like istanbul
1926
coverage
27+
*.lcov
28+
29+
# nyc test coverage
30+
.nyc_output
2031

21-
# Grunt intermediate storage (http://gruntjs.com/creating-plugins#storing-task-files)
32+
# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
2233
.grunt
2334

35+
# Bower dependency directory (https://bower.io/)
36+
bower_components
37+
2438
# node-waf configuration
2539
.lock-wscript
2640

27-
# Compiled binary addons (http://nodejs.org/api/addons.html)
41+
# Compiled binary addons (https://nodejs.org/api/addons.html)
2842
build/Release
2943

30-
# Dependency directory
31-
# https://docs.npmjs.com/misc/faq#should-i-check-my-node-modules-folder-into-git
32-
node_modules
44+
# Dependency directories
45+
node_modules/
46+
jspm_packages/
47+
48+
# TypeScript v1 declaration files
49+
typings/
50+
51+
# TypeScript cache
52+
*.tsbuildinfo
3353

3454
# Optional npm cache directory
3555
.npm
3656

57+
# Optional eslint cache
58+
.eslintcache
59+
3760
# Optional REPL history
3861
.node_repl_history
3962

63+
# Output of 'npm pack'
64+
*.tgz
65+
66+
# Yarn Integrity file
67+
.yarn-integrity
68+
69+
# dotenv environment variables file
70+
.env
71+
.env.test
72+
73+
# parcel-bundler cache (https://parceljs.org/)
74+
.cache
75+
76+
# next.js build output
77+
.next
78+
79+
# nuxt.js build output
80+
.nuxt
81+
82+
# rollup.js default build output
83+
dist/
84+
85+
# Uncomment the public line if your project uses Gatsby
86+
# https://nextjs.org/blog/next-9-1#public-directory-support
87+
# https://create-react-app.dev/docs/using-the-public-folder/#docsNav
88+
# public
89+
90+
# Storybook build outputs
91+
.out
92+
.storybook-out
93+
94+
# vuepress build output
95+
.vuepress/dist
96+
97+
# Serverless directories
98+
.serverless/
99+
100+
# FuseBox cache
101+
.fusebox/
102+
103+
# DynamoDB Local files
104+
.dynamodb/
105+
106+
# Temporary folders
107+
tmp/
108+
temp/
109+
110+
# End of https://www.gitignore.io/api/node

.jshintrc

Lines changed: 0 additions & 20 deletions
This file was deleted.

.travis.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
11
language: node_js
22
node_js:
3-
- '0.10'
4-
- '0.12'
5-
- '4'
6-
- '5'
3+
- 10
4+
- 12

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ This is really useful if you want to deal with plain old JavaScript objects, but
1212
## Installation
1313

1414
```
15-
npm install --save express body-parser body-parser-xml
15+
npm install express body-parser body-parser-xml
1616
```
1717

1818
## Usage
@@ -22,14 +22,14 @@ This library adds an `xml` method to the `body-parser` object.
2222
Initialise like so:
2323

2424
``` js
25-
var bodyParser = require('body-parser');
25+
const bodyParser = require('body-parser');
2626
require('body-parser-xml')(bodyParser);
2727
```
2828

2929
Once initialised, you can use it just like any other `body-parser` middleware:
3030

3131
``` js
32-
var app = require('express')();
32+
const app = require('express')();
3333
app.use(bodyParser.xml());
3434
```
3535

@@ -80,12 +80,12 @@ This option controls the behaviour of the XML parser. You can pass any option th
8080
## Example
8181

8282
``` js
83-
var express = require('express'),
84-
bodyParser = require('body-parser');
83+
const express = require('express');
84+
const bodyParser = require('body-parser');
8585

8686
require('body-parser-xml')(bodyParser);
8787

88-
var app = express();
88+
const app = express();
8989
app.use(bodyParser.xml({
9090
limit: '1MB', // Reject payload bigger than 1 MB
9191
xmlParseOptions: {

index.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
'use strict';
22

3-
var xml2js = require('xml2js');
3+
const xml2js = require('xml2js');
44

5-
var DEFAULT_TYPES = ['*/xml', '+xml'];
5+
const DEFAULT_TYPES = ['*/xml', '+xml'];
66

77
module.exports = function(bodyParser) {
88
if(bodyParser.xml) {
@@ -19,15 +19,15 @@ module.exports = function(bodyParser) {
1919
options.type = [options.type];
2020
}
2121

22-
var textParser = bodyParser.text(options);
22+
const textParser = bodyParser.text(options);
2323
return function xmlParser(req, res, next) {
2424
// First, run the body through the text parser.
2525
textParser(req, res, function(err) {
2626
if(err) { return next(err); }
2727
if(typeof req.body !== 'string') { return next(); }
2828

2929
// Then, parse as XML.
30-
var parser = new xml2js.Parser(options.xmlParseOptions);
30+
const parser = new xml2js.Parser(options.xmlParseOptions);
3131
parser.parseString(req.body, function(err, xml) {
3232
if(err) {
3333
err.status = 400;

0 commit comments

Comments
 (0)