# flatsheet-api-client

> javascript client for flatsheet

Latest version **2.0.0** (published 2015-04-09) · MIT license · 0 weekly downloads

## Install

```sh
npm install flatsheet-api-client
pnpm add flatsheet-api-client
yarn add flatsheet-api-client
bun add flatsheet-api-client
```

## 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 | 2.0.0 |
| Published | 2015-04-09 |
| First published | 2014-12-11 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 2 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| Maintainers | sethvincent, lukeswart |

## Links

- npm: https://www.npmjs.com/package/flatsheet-api-client
- npm.io page: https://npm.io/package/flatsheet-api-client

## Dependencies (2)

- [xhr](https://npm.io/package/xhr.md) ^1.6.1
- [request](https://npm.io/package/request.md) ^2.34.0

## Recent versions

- 2.0.0 (latest) — 2015-04-09
- 1.2.0 — 2015-03-28
- 1.1.2 — 2014-12-11

## README

# flatsheet-api-client

> JavaScript/node API client for http://github.com/flatsheet/flatsheet



## Todos
Create, update, and destroy methods.

## Install

```
npm install --save flatsheet-api-client
```

## Example usage

```
var Flatsheet = require('flatsheet-api-client');

var flatsheet = new Flatsheet();

/* list of sheets */
flatsheet.sheets.list(function(err, res){
  console.log(err, res)
});

/* specific sheet */
flatsheet.sheets.get(sheetID, function (err, res){
  console.log(err, res);
});
```

## API

### Create flatsheet object

```
var Flatsheet = require('flatsheet-api-client');

var flatsheet = new Flatsheet({
  host: 'https://app.flatsheet.io',
  token: 'YOUR_API_KEY'
});
```

The `host` argument is optional, only use it if you aren't using the hosted version of Flatsheet.
The `token` argument is not needed for GET requests, only for PUT, POST, and DELETE requests.

### Get list of sheets

```
flatsheet.sheets.list(function(err, res){
  console.log(err, res)
});
```

### Get a specific sheet

```
flatsheet.sheets.get(sheetID, function (err, res){
  console.log(err, res);
});
```

### Create a sheet

```
/* Set sheet properties */
var sheet = {
  name: 'pizza sheet!',
  description: 'womp womp womp',
  rows: [
    {
      pizza: 'pizza is really awesome!'
    }
  ],
}

/* create a new sheet */
flatsheet.sheets.create(sheet, function(err, res){
  console.log(err, res)
});
```

### Update a sheet

```
flatsheet.sheets.get(sheetID, function (err, res) {
  res.name = 'change the name of the sheet to this';

  flatsheet.sheets.update(res, function (err, res) {
    console.log(err, res)
  });
});
```

### Add a row to a sheet

```
var row = { pizza: 'wooaaaadddddaaaaoooo' };

flatsheet.sheets.addRow(sheetID, row, function (err, res) {
  console.log(err, res);
});
```

### Destroy a sheet

```
flatsheet.sheets.delete(sheetID, function () {
  flatsheet.sheets.get(sheetID, function (err, res) {
    console.log(err) /* { error: 404 } */
  });
});
```

## Tests
- Clone repository
- Run `npm install`
- Run `npm test`

Tests are currently located in the test.js file.

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