1.1.8 • Published 3 years ago

os-excel-handler v1.1.8

Weekly downloads
1
License
ISC
Repository
-
Last release
3 years ago

Introduction

This module contains functions to deal with excel files.

Installation

Install via npm:

npm i os-excel-handler

Usage

Require excel handler:

var eh = require("os-excel-handler")

Functions and signatures:

/**
 * Will merge a few cells together.
 *
 * @param sheet -> the sheet you work on
 * @param cellIdStart -> like A1
 * @param cellIdEnd -> like A2
 */
mergeCells(sheet, cellIdStart, cellIdEnd)

/**
 * Will set a default font to all of the empty cells in the sheet.
 */
setFontInAllEmptyCells(sheet, name='Arial', size=12, bold=false, italic=false)

/**
 * Will fit the column width to be in the size of the biggest line in the column
 */
fitColumnWidthToText(sheet, colLetter)

/**
 * Also called wrap text. Will set the height of the line to be in the size of the cell content.
 */
wrapText(sheet, cellId) 

/**
 * Will align the text in the cell to be in the middle and center
 */
alignCenter(sheet, cellId)

/**
 * Will read a value from a given cell identifier
 *
 * @param sheet -> the current sheet obj
 * @param cellId -> row and column identifier. Like A4
 */
readValue(sheet, cellId)

/**
 * Will set a value in a given cell id
 *
 * @param sheet -> the current sheet obj
 * @param cellId -> row and column identifier. Like A4
 * @param value -> the value you would like to write
 * @param fontName -> the name of the font in the cell
 * @param fontSize -> the font size in the cell
 * @param bold -> font bold toggle
 * @param italic -> font italic toggle
 */
setValue(sheet, cellId, value, fontName='Arial', fontSize=12, bold=false, italic=false)

/**
 * Will add a sheet to the workbook
 */
createSheet(wb, sheetName, rtl = false)

/**
 * Will create a new workbook to start the work on
 */
createWorkbook()

/**
 *  Will save the workbook in a given path
 */
saveWorkbook: async function (wb, workbookPath)

/**
 * Will set the background color of a given cell
 */
setCellBackgroundColor(sheet, cellId, hexColor)

/**
 * Will set the text color of the text in a given cell
 */
setCellTextColor(sheet, cellId, hexColor)

And more...

Links -> see more tools

  • os-tools-npm -> This module contains fundamental functions to implement in an npm project
  • os-file-handler-npm -> This module contains fundamental files manipulation functions to implement in an npm project
  • os-file-stream-handler-npm -> This module contains read/write and more advanced operations on files
  • os-xml-handler-npm -> This module will build, read and manipulate an xml file. Other handy stuff is also available, like search for specific nodes

GitHub - osfunappsapps

Licence

ISC

1.1.8

3 years ago

1.1.7

3 years ago

1.1.6

3 years ago

1.1.5

3 years ago

1.1.4

3 years ago

1.1.3

3 years ago

1.1.2

3 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.9

5 years ago

1.0.8

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago