Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/kbrashears5/typescript-helper-functions

Typescript Helper Functions
https://github.com/kbrashears5/typescript-helper-functions

functions helper helper-functions helpers javascript typescript

Last synced: 2 months ago
JSON representation

Typescript Helper Functions

Awesome Lists containing this project

README

        

typescript-helper-functions



Helper functions for Typescript

[![CI/CD](https://github.com/kbrashears5/typescript-helper-functions/actions/workflows/ci-cd.yml/badge.svg)](https://github.com/kbrashears5/typescript-helper-functions/actions/workflows/ci-cd.yml)
[![codecov](https://codecov.io/gh/kbrashears5/typescript-helper-functions/branch/master/graph/badge.svg?token=2CVWSV7X7L)](https://codecov.io/gh/kbrashears5/typescript-helper-functions)
[![npm](https://img.shields.io/npm/v/typescript-helper-functions)](https://img.shields.io/npm/v/typescript-helper-functions)
[![npm](https://img.shields.io/npm/dt/typescript-helper-functions)](https://img.shields.io/npm/dt/typescript-helper-functions)

## Install

```
npm install typescript-helper-functions@latest
```

## Usage

### Base Class

Inherit from this class to get some extra functionality

```javascript
public class Class1 extends BaseClass{

}
```

### LogHelper

Helper class to log in a consistent way

```javascript
const logHelper = new LogHelper(LogLevel.Trace);

logHelper.LogInputs('functionName', new { param1, param2 }());
```

### ObjectOperations

Helper class to invoke operations on object types

```javascript
const objectOperations = new ObjectOperations();

logHelper.ToString(true);
```

### Orchestrator

Helper class to invoke operations on object types

```javascript
const logger = new Logger(LogLevel.Trace);

const orchestrator = new Orchestrator(logger);

orchestrator.Orchestrate(() => {
console.log('function');
});
```

## Development

Clone the latest and run

```npm
npm run prep
```

to install packages and prep the git hooks