Gathering detailed insights and metrics for oswedev-autodetect-decoder-stream
Gathering detailed insights and metrics for oswedev-autodetect-decoder-stream
Gathering detailed insights and metrics for oswedev-autodetect-decoder-stream
Gathering detailed insights and metrics for oswedev-autodetect-decoder-stream
An iconv-lite stream that autodetects the encoding and fallbacks to a specified fallback encoding.
npm install oswedev-autodetect-decoder-stream
Typescript
Module System
Min. Node Version
Node Version
NPM Version
JavaScript (100%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
MIT License
31 Stars
25 Commits
9 Forks
2 Watchers
1 Branches
4 Contributors
Updated on Oct 14, 2024
Latest Version
2.0.4
Package Id
oswedev-autodetect-decoder-stream@2.0.4
Unpacked Size
12.39 kB
Size
3.96 kB
File Count
6
NPM Version
6.14.8
Node Version
12.20.0
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
2
An iconv-lite
stream that autodetects the encoding and fallbacks to a specified fallback encoding.
Usage example:
1const AutoDetectDecoderStream = require('autodetect-decoder-stream'); 2 3let stream = fs.createReadStream('1.csv').pipe(new AutoDetectDecoderStream({ defaultEncoding: '1255' })); 4 5stream 6 .on('data', data => { 7 console.log(data); 8 }) 9 .on('end', () => { 10 console.log('Done reading.'); 11 }); 12
Other options that could be passed:
Option | Explanation | Default |
---|---|---|
defaultEncoding | The fallback encoding, if nothing was detected. If "ASCII" is found, it also assumes that there was not enough data to go on, and falls back. | 'utf8' |
minConfidence | Minimum confidence to require for detecting encodings. See jschardet | Depends on jschardet (Currently 0.2) |
consumeSize | How much data to use for detecting the encoding? - in bytes. | 128 bytes |
stripBOM | Should strip the BOM for UTF streams? | true |
If you have anything to contribute, or functionality that you lack - you are more than welcome to participate in this! If anyone wishes to contribute unit tests - that also would be great :-)
If you want to buy me a beer, you are very welcome to
Thanks :-)
All the code here is under MIT license. Which means you could do virtually anything with the code. I will appreciate it very much if you keep an attribution where appropriate.
The MIT License (MIT)
Copyright (c) 2013 Daniel Cohen Gindi (danielgindi@gmail.com)
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
Reason
0 existing vulnerabilities detected
Reason
Found 5/19 approved changesets -- score normalized to 2
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
Score
Last Scanned on 2025-07-07
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