xml-twig 1.3.11 → 1.3.12
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/doc/twig.md +16 -0
- package/package.json +1 -1
- package/samples/memory-test.js +1 -0
- package/twig.js +7 -4
package/doc/twig.md
CHANGED
|
@@ -141,6 +141,7 @@ You can specify a <code>function</code> or a <code>event</code> name</p>
|
|
|
141
141
|
* [.pinned](#Twig+pinned) ⇒ <code>boolean</code>
|
|
142
142
|
* [.close](#Twig+close)
|
|
143
143
|
* [.debug](#Twig+debug) ⇒ <code>string</code>
|
|
144
|
+
* [.toString](#Twig+toString) ⇒ <code>string</code>
|
|
144
145
|
* [.addChild](#Twig+addChild) ℗
|
|
145
146
|
* [.writer](#Twig+writer) ⇒ [<code>XMLWriter</code>](https://www.npmjs.com/package/xml-writer)
|
|
146
147
|
* [.attr](#Twig+attr) ⇒ <code>string</code> \| <code>number</code> \| <code>object</code>
|
|
@@ -360,6 +361,13 @@ XML-Twig for dummies :-)
|
|
|
360
361
|
|
|
361
362
|
**Kind**: instance property of [<code>Twig</code>](#Twig)
|
|
362
363
|
**Returns**: <code>string</code> - The XML-Tree which is currently available in RAM - no valid XML Structure
|
|
364
|
+
<a name="Twig+toString"></a>
|
|
365
|
+
|
|
366
|
+
### twig.toString ⇒ <code>string</code>
|
|
367
|
+
Returns XML string of the element
|
|
368
|
+
|
|
369
|
+
**Kind**: instance property of [<code>Twig</code>](#Twig)
|
|
370
|
+
**Returns**: <code>string</code> - The XML-Element as string
|
|
363
371
|
<a name="Twig+addChild"></a>
|
|
364
372
|
|
|
365
373
|
### twig.addChild ℗
|
|
@@ -758,6 +766,7 @@ Common function to filter Twig element
|
|
|
758
766
|
* [.pinned](#Twig+pinned) ⇒ <code>boolean</code>
|
|
759
767
|
* [.close](#Twig+close)
|
|
760
768
|
* [.debug](#Twig+debug) ⇒ <code>string</code>
|
|
769
|
+
* [.toString](#Twig+toString) ⇒ <code>string</code>
|
|
761
770
|
* [.addChild](#Twig+addChild) ℗
|
|
762
771
|
* [.writer](#Twig+writer) ⇒ [<code>XMLWriter</code>](https://www.npmjs.com/package/xml-writer)
|
|
763
772
|
* [.attr](#Twig+attr) ⇒ <code>string</code> \| <code>number</code> \| <code>object</code>
|
|
@@ -977,6 +986,13 @@ XML-Twig for dummies :-)
|
|
|
977
986
|
|
|
978
987
|
**Kind**: instance property of [<code>Twig</code>](#Twig)
|
|
979
988
|
**Returns**: <code>string</code> - The XML-Tree which is currently available in RAM - no valid XML Structure
|
|
989
|
+
<a name="Twig+toString"></a>
|
|
990
|
+
|
|
991
|
+
### twig.toString ⇒ <code>string</code>
|
|
992
|
+
Returns XML string of the element
|
|
993
|
+
|
|
994
|
+
**Kind**: instance property of [<code>Twig</code>](#Twig)
|
|
995
|
+
**Returns**: <code>string</code> - The XML-Element as string
|
|
980
996
|
<a name="Twig+addChild"></a>
|
|
981
997
|
|
|
982
998
|
### twig.addChild ℗
|
package/package.json
CHANGED
package/samples/memory-test.js
CHANGED
|
@@ -6,6 +6,7 @@ let Entry = 0;
|
|
|
6
6
|
|
|
7
7
|
let parser = twig.createParser([{ tag: 'Entry', function: EntryHandler }], { method: 'expat' })
|
|
8
8
|
// http://aiweb.cs.washington.edu/research/projects/xmltk/xmldata/data/SwissProt/SwissProt.xml.gz
|
|
9
|
+
// For more files see http://aiweb.cs.washington.edu/research/projects/xmltk/xmldata/www/repository.html
|
|
9
10
|
let reader = fs.createReadStream(`SwissProt.xml`);
|
|
10
11
|
reader.pipe(parser);
|
|
11
12
|
|
package/twig.js
CHANGED
|
@@ -35,10 +35,13 @@ let current;
|
|
|
35
35
|
* @see {@link https://www.npmjs.com/package/libxmljs|libxmljs}
|
|
36
36
|
*/
|
|
37
37
|
|
|
38
|
-
|
|
39
|
-
*
|
|
40
|
-
* @
|
|
41
|
-
*
|
|
38
|
+
/*
|
|
39
|
+
* Other parsers I had a look at:
|
|
40
|
+
* {@link https://www.npmjs.com/package/sax-wasm|sax-wasm}: not a 'stream.Writable'
|
|
41
|
+
* {@link https://www.npmjs.com/package/@rubensworks/saxes|saxes}: not a 'stream.Writable'
|
|
42
|
+
* {@link https://www.npmjs.com/package/node-xml-stream|node-xml-stream}: should work, but not implemented
|
|
43
|
+
* {@link https://www.npmjs.com/package/saxes-stream|saxes-stream}: not a 'stream.Writable'
|
|
44
|
+
* {@link https://www.npmjs.com/package/xml-streamer|xml-streamer}: based on 'node-expat', does not add any benefit
|
|
42
45
|
*/
|
|
43
46
|
|
|
44
47
|
|