-
Notifications
You must be signed in to change notification settings - Fork 8
API Documentation
-
NullXlsx - Minimal xlsx file generator
- new NullXlsx(filename, options)
-
.addSheetFromData(data, name) ⇒
NullXlsx -
.generate() ⇒
ArrayBuffer -
.createDownloadUrl() ⇒
string -
.createDownloadLink(linkText) ⇒
Element
- NullZipArchive - A non-compressing zip archive
Minimal javascript library to create xlsx files
Creates a new xlsx file
| Param | Type | Description |
|---|---|---|
| filename | string |
Name of file once generated |
| options | Object |
Settings |
nullXlsx.addSheetFromData(data, name) ⇒ NullXlsx
Create a spreadsheet from an array of arrays of data
Returns: NullXlsx - Returns itself for method chaining
| Param | Type | Description |
|---|---|---|
| data | Array.<Array.<*>> |
Cell values |
| name | string |
Name of sheet |
Generates the xlsx file
Returns: ArrayBuffer - Array buffer containing the xlsx
Creates an ObjectURL blob containing the generated xlsx
Returns: string - ObjectURL to xlsx
Create download (or update existing)
Returns: Element - Link object
| Param | Type | Description |
|---|---|---|
| linkText |
string | Element
|
Existing link object or text to set on new link |
A minimal non-compressing zip archive
Creates a new non-compressing zip archive
| Param | Type | Description |
|---|---|---|
| filename | string |
File names. Must be ASCII |
| [createFolderEntries] | boolean |
If true a zip entry is made for each folder (subfolders should work without this) |
Add a text file to the archive, specifying the text
Returns: NullZipArchive - Returns itself for method chaining
| Param | Type | Description |
|---|---|---|
| filename | string |
File name, including directory path (e.g. subdir/text.txt) |
| content | string |
File contents |
Add a file to the archive, using an array buffer as source data
Returns: NullZipArchive - Returns itself for method chaining
| Param | Type | Description |
|---|---|---|
| filename | string |
File name, including directory path (e.g. subdir/text.txt) |
| binaryContent | Uint8Array |
Array buffer |
Generate a zip archive
Returns: ArrayBuffer - Array buffer containing the zip archive
Creates an ObjectURL blob containing the generated xlsx
Returns: string - ObjectURL to xlsx
Create download link object (or update existing)
Returns: Element - Link object
| Param | Type | Description |
|---|---|---|
| linkText |
string | HTMLAnchorElement
|
Existing link object or text to set on new link |