# @indicia-js/core

> Indicia JavaScript SDK.

Latest version **6.1.0** (published 2021-12-12) · GNU GPL v3 license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install @indicia-js/core
pnpm add @indicia-js/core
yarn add @indicia-js/core
bun add @indicia-js/core
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 6.1.0 |
| Published | 2021-12-12 |
| First published | 2020-02-07 |
| Weekly downloads | 0 |
| License | GNU GPL v3 |
| TypeScript types | none |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 109.5 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 2 |
| Author | Karolis Kazlauskis |
| Maintainers | kazlauskis |
| Keywords | indicia, biological, wildlife, recording |

## Links

- npm: https://www.npmjs.com/package/@indicia-js/core
- Repository: https://github.com/Indicia-Team/indicia-js
- Issues: https://github.com/Indicia-Team/indicia-js/issues
- npm.io page: https://npm.io/package/@indicia-js/core

## Dependencies (1)

- [@babel/runtime](https://npm.io/package/@babel/runtime.md) ^7.7.2

## Alternatives

- [cli-color](https://npm.io/package/cli-color.md) — 3.4M weekly downloads
- [log](https://npm.io/package/log.md) — 1.3M weekly downloads
- [logstash-client](https://npm.io/package/logstash-client.md) — 4.5K weekly downloads
- [@nocobase/plugin-logger](https://npm.io/package/@nocobase/plugin-logger.md) — 2.0K weekly downloads
- [child-process-debug](https://npm.io/package/child-process-debug.md) — 695 weekly downloads

## Recent versions

- 6.1.0 (latest) — 2021-12-12
- 6.0.0 — 2021-08-05
- 5.4.0 — 2020-06-24
- 5.3.0 — 2020-06-24
- 5.2.2 — 2020-06-22
- 5.2.1 — 2020-06-22
- 5.2.0 — 2020-06-20
- 5.1.1 — 2020-03-31
- 5.1.0 — 2020-03-30
- 5.0.0 — 2020-02-07

## README

# @indicia-js/core [![version](https://img.shields.io/npm/v/@indicia-js/core/latest.svg)](https://www.npmjs.com/package/@indicia-js/core) [![Build Status](https://travis-ci.org/Indicia-Team/indicia-js.svg)](https://travis-ci.org/Indicia-Team/indicia-js)

A tiny library with no dependencies that helps to manage biological records based on Samples and Occurrences.

## Usage

```javascript
import { Sample, Occurrence, Media } from '@indicia-js/core';

// Sample
var sample = new Sample();
sample.attrs.date = '12/2/2012';
sample.attrs.location = '12.345, -12.345';

// Occurrence
var occ = new Occurrence();
occ.attrs.taxon = 'bee';
occ.attrs.number = 5;
occ.attrs.colours = ['red', 'green'];

sample.occurrences.push(occ);

// Image
var image = new Media();
await image.resize(800, 400);
await image.addThumbnail();

occ.media.push(image);
```

## Initialization

### Step 1: Get the library

```
npm i @indicia-js/core
```

### Step 2: include JS files

You can find them in the root folder of the library.

```html
<!-- Add JS library file -->
<script src="path/to/indicia.js"></script>
```
or 

```javascript
import { Sample, Occurrence, Media } from 'indicia';
```

### API

```typescript

// all models
static Model.fromJSON() ⇒ Promise

model.cid: UUID
model.attrs: Object
model.metadata: Object

model.toJSON() ⇒ Promise


// Sample
sample.occurrences: Array
sample.samples: Array
sample.media: Array

// Occurrence
occurrence.media: Array

// Media
media.getURL() ⇒ String
media.addThumbnail() ⇒ Promise
media.resize(MAX_WIDTH, MAX_HEIGHT) ⇒ Promise

```

## Bugs and feature requests

Have a bug or a feature request? search for existing and closed issues. [Please open a new issue](https://github.com/Indicia-Team/indicia-js/issues).

## Creators

**Karolis Kazlauskis**

- <https://github.com/flumensio>

## Copyright and license

Code and documentation copyright 2020 CEH. Code released under the [GNU GPL v3 license](LICENSE).

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