# logworks

> Logworks API wrapper

Latest version **7.0.0** (published 2015-11-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install logworks
pnpm add logworks
yarn add logworks
bun add logworks
```

## 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 | 7.0.0 |
| Published | 2015-11-05 |
| First published | 2015-06-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 0 |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Arpith Siromoney |
| Maintainers | arpith |

## Links

- npm: https://www.npmjs.com/package/logworks
- Repository: https://github.com/arpith/logworks-node
- Homepage: https://github.com/arpith/logworks-node#readme
- Issues: https://github.com/arpith/logworks-node/issues
- npm.io page: https://npm.io/package/logworks

## Recent versions

- 7.0.0 (latest) — 2015-11-05
- 6.0.1 — 2015-10-26
- 6.0.0 — 2015-10-21
- 5.0.2 — 2015-10-01
- 5.0.1 — 2015-10-01
- 5.0.0 — 2015-10-01
- 4.1.3 — 2015-09-30
- 4.1.2 — 2015-09-30
- 4.1.1 — 2015-09-30
- 4.1.0 — 2015-09-30
- 4.0.5 — 2015-09-22
- 4.0.4 — 2015-09-21
- 4.0.3 — 2015-09-21
- 4.0.2 — 2015-09-21
- 4.0.1 — 2015-09-21
- … 42 more at https://npm.io/package/logworks/versions

## README

# Logworks node.js bindings
Node library to access the Logworks API using [Immutable collections](https://github.com/facebook/immutable-js)
Expects Fetch and Promise.

## Installation
`$ npm install logworks`

## Usage
See https://github.com/logworks/logworks-test

### Overview
Every resource is accessed via your `logworks` instance:

```
var logworks = require('logworks')('logworks_api_url');
// logworks.{ RESOURCE NAME }.{ METHOD NAME }
```

Every resource method accepts an optional callback as the last argument:

```
logworks.logs.create(function(err, log) {
  err; // null if no error ocurred
  log; // Immutable Map with 'id', 'data' and 'entries' where 'data' is an Immutable Map and 'entries' is an Immutable List
}
```

Additionally, every resource method returns a promise, so you don't have to use the regular callback, e.g:

```
// Create a new log and then a new entry in that log:
logworks.logs.create().then(function(log) {
  return logworks.entries.create(log.id, {type:'text', data:'Hello World'});
}).then(function(entry) {
  entry; // Immutable map with 'id', 'type', 'data', 'created' and 'updated'
  // New entry was created
}, function(err) {
  // Deal with the error
}); 
```

### Available resources & methods
* logs
  * create()
  * show(logurl)
  * edit(logid, data)
  * del(logid)
  * generateSignedURL(logid)

* entries
  * create(logid, {type: "type", data: "data"})
  * edit(logid, entryid, {type: "type", data: "newdata"})
  * del(logid, entryid)

### Notes
`generateSignedURL` generates URLs that can be used to upload images. The response looks like `{signedURL: 'foo', url: 'bar'}` where `url` is the url that the image will be accessible on, and `signedURL` is the url that you should use to upload the image.

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