npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

excel-push-pull

v0.1.3

Published

Push/Pull lines of data to/from an excel xlsx

Readme

#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 stream
  • setXLSXBuffer(buffer) set a zip buffer
  • setFilePath(filePath) set a file path

###Push

  • record(json, sheetId=1) push a json to sheet in sheetId
  • records(array, sheetId=1) push an array of json to sheet in sheetId
  • pipe(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"
}]