# astronode-plugin

> Module with plugin interfaces and parsers to astronode

Latest version **1.1.13** (published 2018-03-02) · MIT license · 0 weekly downloads

## Install

```sh
npm install astronode-plugin
pnpm add astronode-plugin
yarn add astronode-plugin
bun add astronode-plugin
```

## 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.1.13 |
| Published | 2018-03-02 |
| First published | 2018-01-22 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 1 |
| Unpacked size | 8.7 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Guilherme Diego |
| Maintainers | monumentum |
| Keywords | jest, es6, adapter, interface, astronode, astrostack |

## Links

- npm: https://www.npmjs.com/package/astronode-plugin
- Repository: https://github.com/monumentum/astronode-plugin
- Homepage: https://github.com/monumentum/astronode-plugin#readme
- Issues: https://github.com/monumentum/astronode-plugin/issues
- npm.io page: https://npm.io/package/astronode-plugin

## Dependencies (1)

- [lodash](https://npm.io/package/lodash.md) ^4.17.4

## Recent versions

- 1.1.13 (latest) — 2018-03-02
- 1.1.12 — 2018-02-27
- 1.1.11 — 2018-02-09
- 1.1.10 — 2018-02-09
- 1.1.9 — 2018-02-08
- 1.1.8 — 2018-02-04
- 1.1.6 — 2018-01-31
- 1.1.4 — 2018-01-24
- 1.1.3 — 2018-01-23
- 1.1.2 — 2018-01-23
- 1.1.1 — 2018-01-23
- 1.1.0 — 2018-01-23
- 1.0.0 — 2018-01-22

## README

# Astronode Plugin
[![npm](https://img.shields.io/npm/v/astronode-plugin.svg)](https://www.npmjs.com/package/astronode-plugin) [![Build Status](https://travis-ci.org/monumentum/astronode-plugin.svg?branch=master)](https://travis-ci.org/monumentum/astronode-plugin) [![Coverage Status](https://coveralls.io/repos/github/monumentum/astronode-plugin/badge.svg?branch=master)](https://coveralls.io/github/monumentum/astronode-plugin?branch=master) [![bitHound Overall Score](https://www.bithound.io/github/monumentum/astronode-plugin/badges/score.svg)](https://www.bithound.io/github/monumentum/astronode-plugin) [![bitHound Dependencies](https://www.bithound.io/github/monumentum/astronode-plugin/badges/dependencies.svg)](https://www.bithound.io/github/monumentum/astronode-plugin/master/dependencies/npm) [![bitHound Dev Dependencies](https://www.bithound.io/github/monumentum/astronode-plugin/badges/devDependencies.svg)](https://www.bithound.io/github/monumentum/astronode-plugin/master/dependencies/npm) [![bitHound Code](https://www.bithound.io/github/monumentum/astronode-plugin/badges/code.svg)](https://www.bithound.io/github/monumentum/astronode-plugin) 

This is a simple package with some interfaces to create your on Engine and Data plugins to astronode :)

### How to Use It
First of all you need to install the package inside you plugin `npm install --save astronode-plugin`  

#### EngineAdapter
To create an Engine adapter you will import `EngineAdapter` from `astronode-plugin`. After it extends this class an override methods `createRoute` and `start`.  

**createRoute**: Will be called everytime when astronode receive a route register request, it comes with the follow parameters: `path, method, middlewares, callback`  
**start**: Method used to initializate the server.  

*Example: https://github.com/monumentum/astronode-express-plugin*

#### DataAdapter & DataMethods
To crete an Data adapter you need first of all understand how it works, we had three parts in this process:
- You need to map the five base methods from a CRUD *(find, findById, create, update and delete)* using `DataMethods` interface.
- You will need extends `DataAdapter` calling `super` with the your `DataMethods` implementation for this ORM.
- You will need implement a method `autoinitializate` in your `DataAdapter` to open database connection and setup.

*Example: https://github.com/monumentum/astronode-mongoose-plugin*

#### Contribuiting
// TODO

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