# @santech/core

> Core module for santech studio

Latest version **7.0.0-beta.4** (published 2019-02-06) · MIT license · 0 weekly downloads

## Install

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

## Health

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

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

Warnings: low downloads.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 7.0.0-beta.4 |
| Published | 2019-02-06 |
| First published | 2018-04-25 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 0 |
| Unpacked size | 1.1 MB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Author | Paul Souche |
| Maintainers | outilssantech |
| Keywords | santech, studio, core, fetch, http, storage, jwt |

## Links

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

## 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

- 7.0.0-beta.4 (latest) — 2019-02-06
- 7.0.0-alpha.16 — 2019-02-06
- 7.0.0-beta.3 — 2018-11-15
- 7.0.0-alpha.15 — 2018-11-14
- 7.0.0-beta.2 — 2018-11-05
- 7.0.0-beta.1 — 2018-10-12
- 7.0.0-beta.0 — 2018-08-28
- 7.0.0-alpha.14 — 2018-08-23
- 7.0.0-alpha.13 — 2018-07-31
- 7.0.0-alpha.12 — 2018-07-24
- 7.0.0-alpha.11 — 2018-07-23
- 7.0.0-alpha.10 — 2018-06-26
- 7.0.0-alpha.9 — 2018-06-21
- 7.0.0-alpha.8 — 2018-06-02
- 7.0.0-alpha.7 — 2018-05-30
- … 7 more at https://npm.io/package/@santech/core/versions

## README

@santech/core
[![Dependency Status](https://david-dm.org/santech-org/studio/status.svg?path=%40santech%2Fcore)](https://david-dm.org/santech-org/studio?path=%40santech%2Fcore)
[![devDependency Status](https://david-dm.org/santech-org/studio/dev-status.svg?path=%40santech%2Fcore)](https://david-dm.org/santech-org/studio?path=%40santech%2Fcore&type=dev)
========

@santech/core is a npm module that exports core models of the santech studio

## Prerequisites

You need to have globally installed:

* node 9.x.x
* npm 5.x.x
* yarn 1.x.x

## Development

Install all the dependencies

```
yarn
```

Launch tests

```
npm test
```

Build the package

```
yarn build
```

Publish the package

```
npm publish
```

## Require package in your project

```
npm i @santech/core -S
```

Import module

```javascript
import { Http } from '@santech/core';
// or
var Http = require('@santech/core').Http;
// or
var Http = Santech.Core.Http;
```

## Examples

Angular 1

```html
<script type="text/javascript" src="./node_modules/@santech/core/dist/umd/index.js"></script>
```

```javascript
class MyCtrl {
  constructor(http) {
    http.get('some/url')
      .then((res => {
        console.log(res.data.foo);
      });
  }
}

angular.module('santech', [])
  .factory('santech-http', () => new Santech.Core.Http(fetch, Headers))
  .controller('MyCtrl', ['santech-http', MyCtrl])
  .run(['santech-http', '$rootScope', function (http, $rootScope) {
    http.addInterceptor({
      response: (res) => {
        $rootScope.$applyAsync();
        return res;
      }
    })
  }]);
```

Angular 2

```typescript
import { Component, Optional } from '@angular/core';
import { Http } from '@santech/core';

interface FooBar {
  foo: string;
}

@Component({
  providers: [{
    provide: Http,
    useFactory: () => new Http(fetch, Headers),
  }],
  selector: 'app-root',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.css']
})
export class AppComponent {
  constructor(http: Http) {
    http.get<FooBar>('some/url')
      .then((res => {
        console.log(res.data.foo);
      });
  }
}
```

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