New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

node-sheet

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

node-sheet

A simple way to create spreadsheets.

latest
npmnpm
Version
0.3.1-beta
Version published
Maintainers
1
Created
Source

NODE-SHEET (beta)

GitHub repo size GitHub language count GitHub forks Bitbucket open issues

A simple way to create spreadsheets.

Disclaimer

It is not recommended to use this library in real projects.

Installing node-sheet

Use one of the commands below to install the node-sheet:

npm install node-sheet
yarn add node-sheet
pnpm add node-sheet

Using node-sheet

ClassDescription
WorkbookMain class that manages the worksheet
WorksheetClass that manages each sheet page
ColumnClass used to build each column of the worksheet
HeaderClass used to add the headers of each column that is able to define patterns for all the cells of the column
CellClass used to insert rows to the column

Here's how you can create a basic spreadsheet containing name, age and gender:

const { Worksheet, Column, Header, Cell, Workbook } = require('node-sheet');

const worksheet = new Worksheet('Page 1');  // Page 1 is the page name

worksheet.addColumns([
  new Column({
    header: new Header({ title: 'Name' }),
    cells: [new Cell('John'), new Cell('Maria'), new Cell('Joseph')],
  }),
  new Column({
    header: new Header({ title: 'Age' }),
    cells: [new Cell(20), new Cell(30), new Cell(40)],
  }),
  new Column({
    header: new Header({ title: 'Gender' }),
    cells: [new Cell('Male'), new Cell('Female'), new Cell('Male')],
  }),
]);

new Workbook().addWorksheet(worksheet).export('worksheet-name');

Pay attention: the cells will be organized according to the order they are arranged in cells.

the export method will create a sheet at the root named according to the string passed by parameter. The result will be a spreadsheet like this:

NameAgeGender
John20Male
Maria30Female
Joseph40Male

Keywords

xlsx

FAQs

Package last updated on 24 Mar 2023

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