
Security News
Browserslist-rs Gets Major Refactor, Cutting Binary Size by Over 1MB
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
excel-push-pull
Advanced tools
#excel-push-pull
##Push lines to pre-defined excel files
var Push = require('excel-push-pull').Push;
var push = new Push();
var fs = require('fs');
var rs = fs.createReadStream('PATH_TO_INPUT_XLSX_FILE');
push.setXLSXStream(rs);
// Use this method to push a single record
push.record({
// json data
});
// Use this method to push multiple records
push.records([{
// json data
}]);
var ws = fs.createWriteStream('PATH_TO_OUTPUT_XLSX_FILE');
push.pipe(ws);
ws.on('close', function() {
// all data piped to ws
});
##Pull records from pre-defined and pre-filled excel files
var Pull = require('excel-push-pull').Pull;
var pull = new Pull();
pull.setFilePath('PATH_TO_INPUT_XLSX_FILE');
pull.records(function(err, records) {
// records is an array contains json data
});
##API
setXLSXStream(readStream)
set a read streamsetXLSXBuffer(buffer)
set a zip buffersetFilePath(filePath)
set a file path###Push
record(json, sheetId=1)
push a json to sheet in sheetIdrecords(array, sheetId=1)
push an array of json to sheet in sheetIdpipe(writeStream)
pipe out the records added xlsx binary stream###Pull
records(sheedId=1, callback)
pull an array of json from sheet in sheetId
callback is in nodejs style, callback(err, records)
where records is an array
of data, empty line is trimed off.
##Example ###Excel file template
No. | Name | Grade | Score |
---|---|---|---|
##no | ##name | ##grade | ##score |
###Push
The data we wanna push to the excel:
[{
"no": 1,
"name": "John",
"grade": "First Year",
"score": "B"
}, {
"no": 2,
"name": "Lee",
"grade": "First Year",
"score": "A"
}, {
"no": 3,
"name": "Tom",
"grade": "Second Year",
"score": "C"
}]
After pushing, we get:
No. | Name | Grade | Score |
---|---|---|---|
##no | ##name | ##grade | ##score |
1 | John | First Year | B |
2 | Lee | First Year | A |
3 | Tom | Second Year | C |
###Pull
If we pull records from the blowing table, we get:
[{
"no": 1,
"name": "John",
"grade": "First Year",
"score": "B"
}, {
"no": 2,
"name": "Lee",
"grade": "First Year",
"score": "A"
}, {
"no": 3,
"name": "Tom",
"grade": "Second Year",
"score": "C"
}]
FAQs
Push/Pull lines of data to/from an excel xlsx
The npm package excel-push-pull receives a total of 8 weekly downloads. As such, excel-push-pull popularity was classified as not popular.
We found that excel-push-pull 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
Browserslist-rs now uses static data to reduce binary size by over 1MB, improving memory use and performance for Rust-based frontend tools.
Research
Security News
Eight new malicious Firefox extensions impersonate games, steal OAuth tokens, hijack sessions, and exploit browser permissions to spy on users.
Security News
The official Go SDK for the Model Context Protocol is in development, with a stable, production-ready release expected by August 2025.