4 Commits

Author SHA1 Message Date
Sai1919
c742d92e32 bump version to 0.2.3 from 0.2.1 2018-12-03 16:25:05 +05:30
Sai1919
7fe1a03d98 upgrade lodash to fix vunerability 2018-12-03 15:53:10 +05:30
Sai Teja
8b6cf41277 update readme 2017-04-01 12:00:04 -07:00
Sai Teja
5da96b5528 0.2.1 2017-04-01 11:51:45 -07:00
2 changed files with 8 additions and 2 deletions

View File

@@ -137,6 +137,7 @@ npm install xml-streamer
* `#resume()` resumes
* `#read()` returns object if stream is readable
## Available Constructor Options
* `resourcePath`: `Type: String` Optional field. Used to extract the XML nodes that you are interested in.
@@ -161,6 +162,7 @@ npm install xml-streamer
if you are interested in `items` nodes then resourcePath would be: `/items`
* `emitOnNodeName`: `Type: Boolean` Optional field. Set this to true if you want to listen on node names instead of data event. `default: false`
// Ex: consider the above XML snippet
@@ -181,6 +183,7 @@ npm install xml-streamer
`NOTE:` when you set `emitOnNodeName:true` "data" events are emitted normally. So make sure you don't listen for both the events.
* `attrsKey`: `Type: String` Optional field. pass the value with which you want to reference attributes of a node in its object form. `default: '$'`
* `textKey`: `Type: String` Optional field. pass the value with which you want to reference node value in its object form. `default: '_'`
@@ -203,6 +206,7 @@ npm install xml-streamer
```
// Then set `attrsKey= "attrs"` and `textKey= "text"`
* `explicitArray`: `Type: Boolean` Optional field. `Default value is true`. All children nodes will come in an array when this option is true.
// Ex: For example let the XML be
@@ -224,10 +228,12 @@ npm install xml-streamer
```
`caution:` When explicitArray set to false and if there are multiple children nodes with same name then last node will override all preceding nodes.
## upcoming features
1. `handling of compressed streams`
2. `handling of different encodings`
3. `Filtering of objects extracted from resourcePath based on xpaths and json paths`
## Namespace handling

View File

@@ -1,5 +1,5 @@
{
"version": "0.2.0",
"version": "0.2.3",
"name": "xml-streamer",
"description": "XML stream parser for parsing large files efficiently with less usage of memory.",
"author": {
@@ -25,7 +25,7 @@
},
"dependencies": {
"node-expat": "2.3.15",
"lodash": "4.16.6"
"lodash": "4.17.5"
},
"devDependencies": {
"mocha": "^1.21.4",