# js-export

> Utilities to export js data into different acceptable format

Latest version **0.1.0** (published 2015-11-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install js-export
pnpm add js-export
yarn add js-export
bun add js-export
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.1.0 |
| Published | 2015-11-23 |
| First published | 2015-11-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+6 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 1 |
| Author | lykmapipo |
| Maintainers | lykmapipo |
| Keywords | export, excel, csv, text |

## Links

- npm: https://www.npmjs.com/package/js-export
- Repository: https://github.com/lykmapipo/js-export
- Homepage: https://github.com/lykmapipo/js-export#readme
- Issues: https://github.com/lykmapipo/js-export/issues
- npm.io page: https://npm.io/package/js-export

## Dependencies (4)

- [csv](https://npm.io/package/csv.md) ^0.4.6
- [async](https://npm.io/package/async.md) ^1.5.0
- [lodash](https://npm.io/package/lodash.md) ^3.10.1
- [xlsx-tools](https://npm.io/package/xlsx-tools.md) 0.0.5

## Alternatives

- [@sapphire/ratelimits](https://npm.io/package/@sapphire/ratelimits.md) — 4.4K weekly downloads
- [js-csvparser](https://npm.io/package/js-csvparser.md) — 2.0K weekly downloads
- [@adadapted/js-sdk](https://npm.io/package/@adadapted/js-sdk.md) — 251 weekly downloads
- [@grapecity/spread-sheets-sparklines](https://npm.io/package/@grapecity/spread-sheets-sparklines.md) — 103 weekly downloads
- [@1selfworld/adchain-sdk-react-native](https://npm.io/package/@1selfworld/adchain-sdk-react-native.md) — 80 weekly downloads

## Recent versions

- 0.1.0 (latest) — 2015-11-23

## README

js-export
==========

[![Build Status](https://travis-ci.org/lykmapipo/js-export.svg?branch=master)](https://travis-ci.org/lykmapipo/js-export)

Utilities to export js data into different acceptable format for [nodejs](https://github.com/nodejs)

## Installation
```sh
$ npm install --save js-export
```

## Usage
```js
var JSExport = require('js-export');
var jsexport = new JSExport(data, options);

//export data as excel file
jsexport.writeExcel(`<file>`, done);

//download data as excel through http requests
app.get('/exports', function(request, response){
   jsexport.downloadExcel(response, options); 
});
```

## Export Engine
Additional export engines can be added as a plugins. It should implement `write` and `download` methods for it to be valid `export engine`.

```js
var JSExport = require('js-export');
var jsexport = new JSExport(data, options);

//buffer engine
var bufferEngine = {
    write: function(path, done){
        //codes
        ...
    },

    download:function(response, options){
        //codes
        ...
    }
}

//use export engine
jsexport.use('buffer', bufferEngine);

//then use buffer export engine
jsexport.writeBuffer(path, done);

```

## Options

- `missing` value to set if object to write does not have the given property. default to `NA`

## Engines

### excel
Export data to excel format

#### Options

- `sheet:String` default sheet name to use. default to `Sheet`
- `multi:Boolean` will put inner plain objects into their own sheet. default to `false`
- `flat:Boolean` will flat inner plain object. default to `true`

*Note!: You may choose flat or multi but not both*

### csv(WIP)
Export data to csv format

### text(WIP)
Export data to text format

### json(WIP)
Export data into json format

---
_Source: https://npm.io/package/js-export · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
