Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

html-to-xlsx

Package Overview
Dependencies
Maintainers
1
Versions
39
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

html-to-xlsx

Convert html to xlsx

  • 0.6.3
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
1.6K
decreased by-7.74%
Maintainers
1
Weekly downloads
 
Created
Source

html-to-xlsx

NPM Version License Build Status

node.js html to xlsx transformation

Transformation only supports html table and several basic style properties. No images or charts are currently supported.

var conversion = require("html-to-xlsx")();
conversion("<table><tr><td>cell value</td></tr></table>" }, function(err, stream){
  //readable stream to xlsx file
  stream.pipe(res);
});

Supported properties

  • background-color - cell background color
  • color - cell foreground color
  • border-left-style - as well as positions will be transformed into excel cells borders
  • text-align - text horizontal align in the excel cell
  • vertical-align - vertical align in the excel cell
  • width - the excel column will get the highest width, it can be little bit inaccurate because of pixel to excel points conversion
  • height - the excel row will get the highest height
  • font-size - font size
  • colspan - numeric value that merges current column with columns to the right
  • rowspan - numeric value that merges current row with rows below.

Options

var conversion = require("html-to-xlsx")({
    /* number of allocated phantomjs processes */
	numberOfWorkers: 2,
	/* timeout in ms for html conversion, when the timeout is reached, the phantom process is recycled */
	timeout: 5000,
	/* directory where are stored temporary html and pdf files, use something like npm package reaper to clean this up */
	tmpDir: "os/tmpdir",
	/* optional port range where to start phantomjs server */
    portLeftBoundary: 1000,
    portRightBoundary: 2000,
    /* optional hostname where to start phantomjs server */
    host: '127.0.0.1'
});

License

See license

Keywords

FAQs

Package last updated on 29 Mar 2017

Did you know?

Socket

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.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc