# adonis-spreadsheet

> Spread sheet provider for adonis framework and has support for csv, xls, xlsx, ods

Latest version **1.0.1** (published 2017-09-01) · MIT license · 0 weekly downloads

## Install

```sh
npm install adonis-spreadsheet
pnpm add adonis-spreadsheet
yarn add adonis-spreadsheet
bun add adonis-spreadsheet
```

## Health

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

Positive: no vulnerabilities.

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

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 1.0.1 |
| Published | 2017-09-01 |
| First published | 2017-09-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+5 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 17 |
| Author | Artem Kolesnik |
| Maintainers | ntvsx193 |
| Keywords | adonis, adonis-framework, spread, sheet, csv, xls, xlsx, ods |

## Links

- npm: https://www.npmjs.com/package/adonis-spreadsheet
- Repository: https://github.com/ntvsx193/adonis-spreadsheet
- Homepage: https://github.com/ntvsx193/adonis-spreadsheet#readme
- Issues: https://github.com/ntvsx193/adonis-spreadsheet/issues
- npm.io page: https://npm.io/package/adonis-spreadsheet

## Dependencies (2)

- [xlsx](https://npm.io/package/xlsx.md) ^0.11.3
- [@adonisjs/validator](https://npm.io/package/@adonisjs/validator.md) ^4.0.3

## Alternatives

- [csv-to-markdown-table](https://npm.io/package/csv-to-markdown-table.md) — 47.0K weekly downloads
- [@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

## Recent versions

- 1.0.1 (latest) — 2017-09-01
- 1.0.0 — 2017-09-01

## README

# Adonis Spread Sheet

This is repo is a AdonisJs provider for simplicity work with sheets docs.
It's base on powerful [SheetJS](https://github.com/SheetJS/js-xlsx)

[![npm version](https://badge.fury.io/js/adonis-spreadsheet.svg)](https://badge.fury.io/js/adonis-spreadsheet)
[![Build Status](https://travis-ci.org/ntvsx193/adonis-spreadsheet.svg?branch=master)](https://travis-ci.org/ntvsx193/adonis-spreadsheet)
[![Coverage Status](https://coveralls.io/repos/github/ntvsx193/adonis-spreadsheet/badge.svg?branch=master)](https://coveralls.io/github/ntvsx193/adonis-spreadsheet?branch=master)

## Install

```
npm i --save adonis-spreadsheet
```

## Registering provider

The provider is registered inside `start/app.js` file under `providers` array.

```js
const providers = [
  'adonis-spreadsheet/providers/SpreadSheetProvider'
]
```

That's all! Now you can use the mail provider as follows.

## Getting started

```js
const Route = use('Route')
const SpreadSheet = use('SpreadSheet')
const User = use('App/Models/User')

Route.get('/users/export/:format', async ({ request, response, params }) => {
  const ss = new SpreadSheet(request, params.format)
  
  const users = await User.all()
  const data = []
  
  data.push([
    'id',
    'First Name',
    'Last Name',
    'Email',
    'Phone'
  ])

  users.toJSON().forEach((user) => {
    data.push([
      user.id,
      user.first_name,
      user.last_name,
      user.phone
    ])
  })

  ss.addSheet('Users', data)
  ss.download('users-export')
})
```

Then you can fire url `/rest/users/export/csv` and received csv file sheet. 

## Supported formats

- xls
- xlsx
- csv
- ods

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