![Create React App Officially Deprecated Amid React 19 Compatibility Issues](https://cdn.sanity.io/images/cgdhsj6q/production/04fa08cf844d798abc0e1a6391c129363cc7e2ab-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Create React App Officially Deprecated Amid React 19 Compatibility Issues
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
formatted-stream
Advanced tools
A universal wrapper around file format parsers.
Currently supports in- and output in CSV, JSON, and XLSX format.
## Usage
Install formatted-stream:
npm install formatted-stream --save
Include and use in your code:
const fs = require('fs'),
formattedStream = require('formatted-stream').default,
parser = formattedStream.from('json'),
writer = formattedStream.to('csv');
parser.pipe(writer);
writer.pipe(fs.createWriteStream('out.csv'));
fs.createReadStream('in.json').pipe(parser);
import fs from 'fs';
import formattedStream from 'formatted-stream';
const parser = formattedStream.from('json'),
writer = formattedStream.to('csv');
parser.pipe(writer);
writer.pipe(fs.createWriteStream('out.csv'));
fs.createReadStream('in.json').pipe(parser);
## API Documentation
### .from(format, options)
const parser = formattedStream.from('csv', {
transform: function(data) { return data; },
csv: {headers: false}
});
Type String
. Must be either xlsx, json, or csv.
Type Function
. A transformation function which is applied to each object before .on('data')
is triggered.
Default is function(data) { return data; }
.
Type Object
. An options object which will be passed to the CSV parser.
See fast-csv for more information.
Default is {headers: true}
.
#### options.json
Type Object
. The value of options.json.path
will be passed to JSONStream.parse
.
See JSONStream for more information.
Default is {path: [true]}
.
Type Object
. An options object which will be passed to the XLSX parser.
Set the XLSX worksheet by defining options.xlsx.sheet
. Default: Sheet 1
See ExcelJS for more options.
Default is {sheet: 'Sheet 1'}
.
### .to(format, options)
const writer = formattedStream.to('json', {
transform: function(data) { return data; },
csv: {headers: false},
json: {
open: '[\n',
sep: '\n,\n',
close: '\n]\n'
}
});
Type String
. Must be either xlsx, json, or csv.
Type Function
. A transformation function which is applied to each object before .on('data')
is triggered.
Default is function(data) { return data; }
.
Type Object
. An options object which will be passed to the CSV writer.
See fast-csv for more information.
Default is {}
.
Type Object
. An options object which will be passed to the JSON writer.
See JSONStream for more information.
Default is {}
.
Type Object
. An options object which will be passed to the XLSX writer.
Assign a function to options.xlsx.headerAccessor
in order to transform all header fields according to the output of the function. Set the XLSX worksheet by defining options.xlsx.sheet
. If no sheet is defined, the XLSX parser will write all sheets in the document to the CSV file. Default: undefined
.
See ExcelJS for more options.
Default is {}
.
FAQs
Streaming XLSX, CSV, and JSON parser and writer
The npm package formatted-stream receives a total of 2 weekly downloads. As such, formatted-stream popularity was classified as not popular.
We found that formatted-stream demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Create React App is officially deprecated due to React 19 issues and lack of maintenance—developers should switch to Vite or other modern alternatives.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.