# @ng-apimock/core

> ng-apimock core module

Latest version **3.12.0** (published 2024-04-05) · MIT license · 0 weekly downloads

## Install

```sh
npm install @ng-apimock/core
pnpm add @ng-apimock/core
yarn add @ng-apimock/core
bun add @ng-apimock/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 | 3.12.0 |
| Published | 2024-04-05 |
| First published | 2018-06-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | CommonJS |
| Dependencies | 9 |
| Unpacked size | 281.6 KB |
| Known vulnerabilities | 0 (+4 in 3 direct dependencies) |
| Install scripts | no |
| GitHub stars | 34 |
| Author | Mischa Dasberg |
| Maintainers | mdasberg, onderceylan |
| Keywords | apimock, ng-apimock, http, api |

## Links

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

## Dependencies (9)

- [glob](https://npm.io/package/glob.md) 10.3.12
- [uuid](https://npm.io/package/uuid.md) 9.0.1
- [debug](https://npm.io/package/debug.md) 4.3.4
- [chokidar](https://npm.io/package/chokidar.md) 3.6.0
- [fs-extra](https://npm.io/package/fs-extra.md) 11.2.0
- [inversify](https://npm.io/package/inversify.md) 6.0.2
- [node-fetch](https://npm.io/package/node-fetch.md) 2.7.0
- [body-parser](https://npm.io/package/body-parser.md) 1.20.2
- [reflect-metadata](https://npm.io/package/reflect-metadata.md) 0.2.2

## Alternatives

- [launchdarkly-js-client-sdk](https://npm.io/package/launchdarkly-js-client-sdk.md) — 2.5M weekly downloads
- [@elastic/elasticsearch](https://npm.io/package/@elastic/elasticsearch.md) — 2.1M weekly downloads
- [@c8y/client](https://npm.io/package/@c8y/client.md) — 15.3K weekly downloads
- [@signaldb/maverickjs](https://npm.io/package/@signaldb/maverickjs.md) — 1.7K weekly downloads
- [@bbc/http-transport-cache](https://npm.io/package/@bbc/http-transport-cache.md) — 1.2K weekly downloads

## Recent versions

- 3.12.0 (latest) — 2024-04-05
- 3.11.2 — 2023-11-14
- 3.11.0 — 2023-04-13
- 3.10.0 — 2023-03-30
- 3.8.0 — 2023-03-22
- 3.7.0 — 2023-01-25
- 3.6.1 — 2023-01-14
- 3.6.0 — 2022-12-08
- 3.5.1 — 2022-10-05
- 3.5.0 — 2022-05-16
- 3.4.0 — 2021-11-29
- 3.3.0 — 2021-11-09
- 3.2.0 — 2021-10-15
- 3.1.0 — 2021-09-06
- 3.0.3 — 2021-07-27
- … 39 more at https://npm.io/package/@ng-apimock/core/versions

## README

# @ng-apimock/core
[![npm](https://img.shields.io/npm/v/@ng-apimock/core?color=brightgreen)](https://www.npmjs.com/package/@ng-apimock/core)
[![Build Status](https://github.com/ng-apimock/core/workflows/CI/badge.svg)](https://github.com/ng-apimock/core/actions?workflow=CI) 
[![Quality Gate Status](https://sonarcloud.io/api/project_badges/measure?project=ng-apimock_core&metric=alert_status)](https://sonarcloud.io/dashboard?id=ng-apimock_core) 
[![Dependabot Status](https://img.shields.io/badge/dependabot-active-success.svg?logo=dependabot)](https://dependabot.com)
![License](https://img.shields.io/github/license/sourcerer-io/hall-of-fame.svg?color=blue) 
![ts](https://badgen.net/badge/-/typeScript/blue?icon=typescript&label)
[![jest](https://img.shields.io/badge/tested_with-jest-99424f.svg?color=blue)](https://github.com/facebook/jest)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg?color=blue)](http://commitizen.github.io/cz-cli/)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-blue.svg)](https://github.com/semantic-release/semantic-release) 
![npm downloads](https://img.shields.io/npm/dm/@ng-apimock/core) 

## Introduction

> ng-apimock is a modular [Node.js](https://nodejs.org/) framework that provides the ability to use scenario based api mocking. 
 
You can use it for:
- [local development](https://ngapimock.org/docs/plugins/plugin-introduction/#local-development)
  - [dev-interface](https://ngapimock.org/docs/plugins/dev-interface)
- [automated testing](https://ngapimock.org/docs/plugins/plugin-introduction/#automated-testing)
  - [WebdriverIO](https://ngapimock.org/docs/plugins/wdio-ng-apimock-service)
  - [Protractor](https://ngapimock.org/docs/plugins/protractor-plugin)
  - [Cypress](https://ngapimock.org/docs/plugins/cypress-plugin)

 
## Installation
```bash
yarn add @ng-apimock/core --dev
```

### Minimal setup example (serve.js)
This is a minimal setup example of how you can manually use @ng-apimock/core
```js
const apimock = require('@ng-apimock/core');
const express = require('express');
const app = express();
app.set('port', 9999);

apimock.processor.process({
    src: 'mocks'
});

app.use(apimock.middleware);

app.listen(app.get('port'), () => {
    console.log('@ng-apimock/core running on port', app.get('port'));
});
```
To start up the script just type:
```bash
node serve.js
```

### Minimal setup example (serve.ts)
This is a minimal setup example in TypeScript of how you can manually use @ng-apimock/core
```ts
import * as apimock from '@ng-apimock/core';
import express, { Application } from 'express';
const app: Application = express();
app.set('port', 9999);

apimock.processor.process({
    src: 'mocks'
});

app.use(apimock.middleware);

app.listen(app.get('port'), () => {
    console.log('@ng-apimock/core running on port', app.get('port'));
});
```


### Endpoints
There are a few endpoints available when you startup `@ng-apimock/core`:
- `/ngapimock/info` - responsible for providing information of the running instance
- `/ngapimock/health` - responsible for providing status information
- `/ngapimock/health/readiness` - readiness probe
- `/ngapimock/health/liveness` - liveness probe

## Contact

We have a few channels for contact:

- [Slack](https://apimock.slack.com/)
- [GitHub Issues](https://github.com/ng-apimock/core/issues)

## Extensive documentation
- [Installation]( https://ngapimock.org/docs/installation) 
- [API]( https://ngapimock.org/docs/api/select-scenario) 
- [Plugins]( https://ngapimock.org/docs/plugins/plugin-introduction)
- [Changelog]( https://github.com/ng-apimock/core/blob/master/CHANGELOG.md)

## License

@ng-apimock is [MIT licensed](./LICENSE-MIT).

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