# @enjine/core

> Core modules to build customized Hosts and Apps on the fly

Latest version **0.0.6** (published 2023-01-27) · MIT license · 0 weekly downloads

## Install

```sh
npm install @enjine/core
pnpm add @enjine/core
yarn add @enjine/core
bun add @enjine/core
```

## Health

**Score 30/100 (F)** — status: abandoned.

Positive: has types; esm support; no vulnerabilities; high quality score.

Warnings: low downloads; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.0.6 |
| Published | 2023-01-27 |
| First published | 2021-04-20 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Node | >=10 |
| Dependencies | 9 |
| Unpacked size | 77.6 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 0 |
| Maintainers | equaliser |

## Links

- npm: https://www.npmjs.com/package/@enjine/core
- Repository: https://github.com/AwesomeEcosystem/enjine
- Homepage: https://github.com/AwesomeEcosystem/enjine#readme
- Issues: https://github.com/AwesomeEcosystem/enjine/issues
- npm.io page: https://npm.io/package/@enjine/core

## Dependencies (9)

- [bcrypt](https://npm.io/package/bcrypt.md) ^5.1.0
- [consola](https://npm.io/package/consola.md) ^2.15.3
- [express](https://npm.io/package/express.md) ^4.18.2
- [socket.io](https://npm.io/package/socket.io.md) ^4.5.4
- [jsonwebtoken](https://npm.io/package/jsonwebtoken.md) ^9.0.0
- [@enjine/utils](https://npm.io/package/@enjine/utils.md) ^0.0.6
- [@bitauth/libauth](https://npm.io/package/@bitauth/libauth.md) ^1.17.1
- [async-constructor](https://npm.io/package/async-constructor.md) ^0.4.17
- [express-http-proxy](https://npm.io/package/express-http-proxy.md) ^1.6.3

## Recent versions

- 0.0.6 (latest) — 2023-01-27
- 0.0.5 — 2023-01-27
- 0.0.3 — 2023-01-27
- 0.0.2 — 2023-01-26
- 0.0.1 — 2023-01-26
- 0.0.1-alpha.28 — 2023-01-25
- 0.0.1-alpha.27 — 2021-08-05
- 0.0.1-alpha.26 — 2021-07-07
- 0.0.1-alpha.25 — 2021-07-07
- 0.0.1-alpha.24 — 2021-07-07
- 0.0.1-alpha.23 — 2021-07-07
- 0.0.1-alpha.19 — 2021-06-30
- 0.0.1-alpha.18 — 2021-06-30
- 0.0.1-alpha.17 — 2021-06-30
- 0.0.1-alpha.16 — 2021-06-30
- … 11 more at https://npm.io/package/@enjine/core/versions

## README

# `@enjine/core`
> v0.0.1

Core Modules to build *scale Instances*

## Usage

```js
import { Host, Instance, Gateway, Controller } from '@enjine/core'

const gateway = new Gateway('anyName', ({ socket, namespace }) => {
  namespace.on('anyEvent', (data) => {

    console.log(data)
    socket.emit('anyResponse')
  })
})

// API will be available on http://localhost:6090/anyName/anyRoute
const controller = new Controller('anyName', ({ router }) => {
  router.get('anyRoute', (req, res) => {

    console.log(req);
    res.send('Any Response')
  })
})


const instance = new Instance({
  gateway: [ gateway ],
  controller: [ controller ]
})

const host = new Host({
  port: 6090,
  host: 'localhost'
})

host.add(instance)

host.bootstrap()
```

> Still Alpha, more soon!

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