# @inward/core

> LoopBack 4 core

Latest version **2.8.0** (published 2020-05-31) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads; no esm support.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 2.8.0 |
| Published | 2020-05-31 |
| First published | 2020-05-31 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Node | >=10 |
| Dependencies | 3 |
| Unpacked size | 185.1 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Inwio |
| Maintainers | towyuan |

## Links

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

## Dependencies (3)

- [debug](https://npm.io/package/debug.md) ^4.1.1
- [tslib](https://npm.io/package/tslib.md) ^2.0.0
- [@inward/context](https://npm.io/package/@inward/context.md) ^3.9.0

## Recent versions

- 2.8.0 (latest) — 2020-05-31

## README

# @inward/core

LoopBack makes it easy to build modern applications that require complex
integrations.

## Overview

- Fast, small, powerful, extensible core
- Generate real APIs with a single command
- Define your data and endpoints with OpenAPI
- No maintenance of generated code

## Installation

```shell
$ npm install --save @inward/core
```

## Basic Use

`@inward/core` provides the foundation for your LoopBack app, but unlike
previous versions, it no longer contains the implementation for listening
servers.

For a typical example of how to create a REST server with your application, see
the
[@inward/rest package.](https://github.com/inwio/inward/tree/master/packages/rest)

## Advanced Use

Since `@inward/core` is decoupled from the listening server implementation,
LoopBack applications are now able to work with any component that provides this
functionality.

```ts
// index.ts
import {Application} from '@inward/core';
import {RestComponent} from '@inward/rest';
import {GrpcComponent} from '@inward/grpc';

const app = new Application({
  rest: {
    port: 3000,
  },
  grpc: {
    port: 3001,
  },
});
app.component(RestComponent); // REST Server
app.component(GrpcComponent)(
  // GRPC Server

  async function start() {
    // Let's retrieve the bound instances of our servers.
    const rest = await app.getServer<RestServer>('RestServer');
    const grpc = await app.getServer<GrpcServer>('GrpcServer');

    // Define all sorts of bindings here to pass configuration or data
    // between your server instances, define controllers and datasources for them,
    // etc...
    await app.start(); // This automatically spins up all your servers, too!
    console.log(`REST server running on port: ${rest.getSync('rest.port')}`);
    console.log(`GRPC server running on port: ${grpc.getSync('grpc.port')}`);
  },
)();
```

In the above example, having a GRPC server mounted on your Application could
enable communication with other GRPC-enabled microservices, allowing things like
dynamic configuration updates.

## Contributions

- [Guidelines](https://github.com/inwio/inward/blob/master/docs/CONTRIBUTING.md)
- [Join the team](https://github.com/inwio/inward/issues/110)

## Tests

Run `npm test` from the root folder.

## Contributors

See [all contributors](https://github.com/inwio/inward/graphs/contributors).

## License

MIT

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