Gathering detailed insights and metrics for saxes-stream
Gathering detailed insights and metrics for saxes-stream
npm install saxes-stream
Typescript
Module System
Node Version
NPM Version
69.8
Supply Chain
99.3
Quality
75.4
Maintenance
100
Vulnerability
80.9
License
TypeScript (94.52%)
JavaScript (5.48%)
Verify real, reachable, and deliverable emails with instant MX records, SMTP checks, and disposable email detection.
Total Downloads
1,376
Last Day
1
Last Week
1
Last Month
17
Last Year
149
GPL-3.0 License
2 Stars
33 Commits
2 Watchers
7 Branches
1 Contributors
Updated on Jun 01, 2021
Minified
Minified + Gzipped
Latest Version
1.1.3
Package Id
saxes-stream@1.1.3
Unpacked Size
48.54 kB
Size
16.46 kB
File Count
9
NPM Version
6.14.3
Node Version
12.16.1
Cumulative downloads
Total Downloads
Last Day
0%
1
Compared to previous day
Last Week
0%
1
Compared to previous week
Last Month
-26.1%
17
Compared to previous month
Last Year
-30.4%
149
Compared to previous year
1
6
NodeJS Streams wrapper around SaxesParser (npm package saxes)
Any string/Buffer Saxes would accept.
1import { SaxesTag } from "saxes"; 2 3export type SaxesStreamChunk = 4 { event: "opentag", path: string, tag: SaxesTag } | 5 { event: "text", path: string, text: string } | 6 { event: "closetag", path: string, tag: SaxesTag };
Standard NodeJS Streams events.
1 2import { SaxesOptions, SaxesStream, SaxesStreamChunk } from "saxes-stream"; 3 4import { Transform, TransformOptions, TransformCallback } from "stream"; 5import request from "request"; 6import fs from "fs"; 7import stringify from "csv-stringify"; 8 9 10/* Source HTTP XML stream */ 11const httpStream = request(url); 12 13 14/* SaxesStream XML parser */ 15const const saxesOptions: SaxesOptions = { 16 // ... 17} 18 19const streamOptions: TransformOptions = { 20 // ... 21} 22 23const parser = new SaxesStream(saxesOptions, streamOptions); 24 25 26/* Custom Transform Stream to pick the data from XML */ 27class BookTransform extends Transform { 28 29 item: any = {}; 30 31 // Stream setting 32 readableObjectMode = true; 33 writableObjectMode = true; 34 35 _transform(chunk: SaxesStreamChunk, encoding: string, callback: TransformCallback) { 36 37 /* Save parts by matching path */ 38 if (chunk.event === "text") { 39 switch (chunk.path) { 40 case ".books.book.title": this.item["title"] = chunk.text; break; 41 case ".books.book.content": this.item["content"] = chunk.text; break; 42 } 43 } 44 45 /* On ending </book> tag emit the completed book object as data (or piped to a next stream) */ 46 if (chunk.event === "closetag") { 47 switch (chunk.path) { 48 case ".books.book": 49 this.push(this.item); 50 this.item = {}; 51 break; 52 } 53 } 54 55 callback(); 56 57 } 58 59} 60 61const bookTransform = new BookTransform(); 62 63 64/* JSON -> CSV Transform Stream */ 65const csv = stringify({ delimiter: ',' }); 66 67 68/* File Write Stream */ 69const file = fs.createWriteStream('./books.csv'); 70 71 72/* PIPE ALL THINGS TOGETHER */ 73httpStream.pipe(parser).pipe(bookTransform).pipe(csv).pipe(file); 74 75
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
Found 0/21 approved changesets -- score normalized to 0
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
23 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-03-10
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More