Skip to content

Commit e8d9634

Browse files
committed
feat: change the package of xml parse
1 parent 32128ed commit e8d9634

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

.travis.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -8,4 +8,4 @@ node_js:
88
- 6
99
- 'stable'
1010

11-
dist: trusty
11+
cache: yarn

lib/index.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,12 @@
11
'use strict'
22

3-
const parser = require('xml2json')
3+
const parser = require('fast-xml-parser')
44
const api = require('./api')
55

66
module.exports = function (word, opt) {
77
if (!opt) opt = {}
88

99
return api
1010
.fetchTerm(word, opt)
11-
.then(xml => parser.toJson(xml, { object: true }))
11+
.then(xml => parser.parse(xml))
1212
}

package.json

+2-2
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,11 @@
2929
"license": "MIT",
3030
"dependencies": {
3131
"chalk": "^2.0.0",
32+
"fast-xml-parser": "^2.6.0",
3233
"meow": "^3.7.0",
3334
"node-fetch": "^1.6.3",
3435
"ora": "^1.3.0",
35-
"update-notifier": "^2.2.0",
36-
"xml2json": "^0.11.0"
36+
"update-notifier": "^2.2.0"
3737
},
3838
"devDependencies": {
3939
"ava": "^0.21.0",

0 commit comments

Comments
 (0)