# offline-todo-api

> Simple (hopefully) RESTful API that allows you to create, read, ~~update~~ and delete items from your todo list.

Latest version **1.0.0** (published 2014-08-23) · MIT license · 0 weekly downloads

## Install

```sh
npm install offline-todo-api
pnpm add offline-todo-api
yarn add offline-todo-api
bun add offline-todo-api
```

Provides the command `offline-todo-api`.

## 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.0 |
| Published | 2014-08-23 |
| First published | 2014-08-23 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Node | 0.10.x |
| Dependencies | 4 |
| Known vulnerabilities | 0 (+1 in 1 direct dependencies) |
| Install scripts | no |
| GitHub stars | 0 |
| Author | Matt Andrews |
| Maintainers | mattandrews |

## Links

- npm: https://www.npmjs.com/package/offline-todo-api
- Repository: https://github.com/matthew-andrews/offline-todo-api
- Issues: https://github.com/matthew-andrews/offline-todo-api/issues
- npm.io page: https://npm.io/package/offline-todo-api

## Dependencies (4)

- [cors](https://npm.io/package/cors.md) ^2.4.1
- [nedb](https://npm.io/package/nedb.md) ^0.10.7
- [express](https://npm.io/package/express.md) ^4.8.3
- [body-parser](https://npm.io/package/body-parser.md) ^1.6.3

## Recent versions

- 1.0.0 (latest) — 2014-08-23

## README

# offline-todo-api [![Build Status](https://travis-ci.org/matthew-andrews/offline-todo-api.svg?branch=master)](https://travis-ci.org/matthew-andrews/offline-todo-api)

Simple (hopefully) RESTful API that allows you to create, read, ~~update~~ and delete items from your todo list.

Note: PUT is not supported as todos are intentionally not updateable in this version.

## Install and run

Quick start:

```
npm install -g offline-todo-api
offline-todo-api
```

Full development build:

```
git clone git@github.com:matthew-andrews/offline-todo-api.git
cd offline-todo-api
npm install
node index.js
```

## Documentation

### GET /todos - list all todos

```
curl https://offline-todo-api.herokuapp.com/todos
```

### GET /todos/:id - read a specific todo

```
curl https://offline-todo-api.herokuapp.com/todos/1408228141678
```

### POST /todos - create a new todo

```
curl https://offline-todo-api.herokuapp.com/todos -X POST -d '{"text":"Do the dishes"}' -H "Content-Type: application/json"
```

#### Input

Name    | Type      | Description
------- | --------- | ------------------------------------
text    | string    | **Required**. The todo text
id      | mixed     | **Required**. Some unique identifier

### DELETE /todos/:id - delete a todo

```
curl https://offline-todo-api.herokuapp.com/todos/1408228141678 -X DELETE
```

Note: once an item has been deleted a todo its `id` cannot be reused.

### GET /todos/stream

Can be used as a event source that will stream an `updated` message whenever a todo is created or deleted.

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